dirtybomb
Version:
A dirty bomb model
1,528 lines (1,527 loc) • 160 kB
JSON
{
"type": "Program",
"body": [
{
"type": "ImportDeclaration",
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"local": {
"type": "Identifier",
"name": "DynamicGaussianPuff",
"range": [
90,
109
],
"loc": {
"start": {
"line": 7,
"column": 7
},
"end": {
"line": 7,
"column": 26
}
}
},
"range": [
90,
109
],
"loc": {
"start": {
"line": 7,
"column": 7
},
"end": {
"line": 7,
"column": 26
}
}
}
],
"source": {
"type": "Literal",
"value": "./DynamicGaussianPuff",
"raw": "'./DynamicGaussianPuff'",
"range": [
115,
138
],
"loc": {
"start": {
"line": 7,
"column": 32
},
"end": {
"line": 7,
"column": 55
}
}
},
"range": [
83,
139
],
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 56
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * Created by austin on 6/16/16.\n * @file DynamicGaussianDecayPuff.js\n * \n ",
"range": [
0,
81
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 5,
"column": 3
}
}
}
],
"trailingComments": [
{
"type": "Block",
"value": "*\n * Adds half life decay to the Dynamic Puff\n ",
"range": [
141,
192
],
"loc": {
"start": {
"line": 9,
"column": 0
},
"end": {
"line": 11,
"column": 3
}
}
}
]
},
{
"type": "Identifier",
"id": {
"type": "Identifier",
"name": "DynamicGaussianDecayPuff",
"range": [
199,
223
],
"loc": {
"start": {
"line": 12,
"column": 6
},
"end": {
"line": 12,
"column": 30
}
}
},
"superClass": {
"type": "Identifier",
"name": "DynamicGaussianPuff",
"range": [
232,
251
],
"loc": {
"start": {
"line": 12,
"column": 39
},
"end": {
"line": 12,
"column": 58
}
}
},
"body": {
"type": "ClassBody",
"body": [
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "constructor",
"range": [
506,
517
],
"loc": {
"start": {
"line": 22,
"column": 4
},
"end": {
"line": 22,
"column": 15
}
}
},
"value": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "atmosphere",
"range": [
518,
528
],
"loc": {
"start": {
"line": 22,
"column": 16
},
"end": {
"line": 22,
"column": 26
}
}
},
{
"type": "Identifier",
"name": "source",
"range": [
530,
536
],
"loc": {
"start": {
"line": 22,
"column": 28
},
"end": {
"line": 22,
"column": 34
}
}
},
{
"type": "Identifier",
"name": "massReleased",
"range": [
538,
550
],
"loc": {
"start": {
"line": 22,
"column": 36
},
"end": {
"line": 22,
"column": 48
}
}
},
{
"type": "Identifier",
"name": "halfLife",
"range": [
552,
560
],
"loc": {
"start": {
"line": 22,
"column": 50
},
"end": {
"line": 22,
"column": 58
}
}
},
{
"type": "Identifier",
"name": "center",
"range": [
562,
568
],
"loc": {
"start": {
"line": 22,
"column": 60
},
"end": {
"line": 22,
"column": 66
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Super",
"range": [
580,
585
],
"loc": {
"start": {
"line": 23,
"column": 8
},
"end": {
"line": 23,
"column": 13
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "atmosphere",
"range": [
586,
596
],
"loc": {
"start": {
"line": 23,
"column": 14
},
"end": {
"line": 23,
"column": 24
}
}
},
{
"type": "Identifier",
"name": "source",
"range": [
598,
604
],
"loc": {
"start": {
"line": 23,
"column": 26
},
"end": {
"line": 23,
"column": 32
}
}
},
{
"type": "Identifier",
"name": "massReleased",
"range": [
606,
618
],
"loc": {
"start": {
"line": 23,
"column": 34
},
"end": {
"line": 23,
"column": 46
}
}
},
{
"type": "Identifier",
"name": "center",
"range": [
620,
626
],
"loc": {
"start": {
"line": 23,
"column": 48
},
"end": {
"line": 23,
"column": 54
}
}
}
],
"range": [
580,
627
],
"loc": {
"start": {
"line": 23,
"column": 8
},
"end": {
"line": 23,
"column": 55
}
}
},
"range": [
580,
628
],
"loc": {
"start": {
"line": 23,
"column": 8
},
"end": {
"line": 23,
"column": 56
}
},
"trailingComments": [
{
"type": "Block",
"value": "*\n *\n * @type {number}\n * @private\n ",
"range": [
638,
710
],
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 29,
"column": 11
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
719,
723
],
"loc": {
"start": {
"line": 30,
"column": 8
},
"end": {
"line": 30,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"name": "_halfLife",
"range": [
724,
733
],
"loc": {
"start": {
"line": 30,
"column": 13
},
"end": {
"line": 30,
"column": 22
}
}
},
"range": [
719,
733
],
"loc": {
"start": {
"line": 30,
"column": 8
},
"end": {
"line": 30,
"column": 22
}
}
},
"right": {
"type": "Identifier",
"name": "halfLife",
"range": [
736,
744
],
"loc": {
"start": {
"line": 30,
"column": 25
},
"end": {
"line": 30,
"column": 33
}
}
},
"range": [
719,
744
],
"loc": {
"start": {
"line": 30,
"column": 8
},
"end": {
"line": 30,
"column": 33
}
}
},
"range": [
719,
745
],
"loc": {
"start": {
"line": 30,
"column": 8
},
"end": {
"line": 30,
"column": 34
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n *\n * @type {number}\n * @private\n ",
"range": [
638,
710
],
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 29,
"column": 11
}
}
}
],
"trailingComments": [
{
"type": "Line",
"value": " Usually the half-life of the pollutant",
"range": [
746,
787
],
"loc": {
"start": {
"line": 30,
"column": 35
},
"end": {
"line": 30,
"column": 76
}
}
},
{
"type": "Block",
"value": "*\n *\n * @type {number}\n * @private\n ",
"range": [
797,
869
],
"loc": {
"start": {
"line": 32,
"column": 8
},
"end": {
"line": 36,
"column": 11
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
878,
882
],
"loc": {
"start": {
"line": 37,
"column": 8
},
"end": {
"line": 37,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"name": "_decayCoeff",
"range": [
883,
894
],
"loc": {
"start": {
"line": 37,
"column": 13
},
"end": {
"line": 37,
"column": 24
}
}
},
"range": [
878,
894
],
"loc": {
"start": {
"line": 37,
"column": 8
},
"end": {
"line": 37,
"column": 24
}
}
},
"right": {
"type": "BinaryExpression",
"operator": "/",
"left": {
"type": "Literal",
"value": 0.693,
"raw": "0.693",
"range": [
897,
902
],
"loc": {
"start": {
"line": 37,
"column": 27
},
"end": {
"line": 37,
"column": 32
}
}
},
"right": {
"type": "Identifier",
"name": "halfLife",
"range": [
905,
913
],
"loc": {
"start": {
"line": 37,
"column": 35
},
"end": {
"line": 37,
"column": 43
}
}
},
"range": [
897,
913
],
"loc": {
"start": {
"line": 37,
"column": 27
},
"end": {
"line": 37,
"column": 43
}
}
},
"range": [
878,
913
],
"loc": {
"start": {
"line": 37,
"column": 8
},
"end": {
"line": 37,
"column": 43
}
}
},
"range": [
878,
914
],
"loc": {
"start": {
"line": 37,
"column": 8
},
"end": {
"line": 37,
"column": 44
}
},
"leadingComments": [
{
"type": "Line",
"value": " Usually the half-life of the pollutant",
"range": [
746,
787
],
"loc": {
"start": {
"line": 30,
"column": 35
},
"end": {
"line": 30,
"column": 76
}
}
},
{
"type": "Block",
"value": "*\n *\n * @type {number}\n * @private\n ",
"range": [
797,
869
],
"loc": {
"start": {
"line": 32,
"column": 8
},
"end": {
"line": 36,
"column": 11
}
}
}
]
}
],
"range": [
570,
920
],
"loc": {
"start": {
"line": 22,
"column": 68
},
"end": {
"line": 38,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
517,
920
],
"loc": {
"start": {
"line": 22,
"column": 15
},
"end": {
"line": 38,
"column": 5
}
}
},
"kind": "constructor",
"computed": false,
"range": [
506,
920
],
"loc": {
"start": {
"line": 22,
"column": 4
},
"end": {
"line": 38,
"column": 5
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n *\n * @param {Atmosphere} atmosphere\n * @param {Source} source\n * @param {number} massReleased\n * @param {number} halfLife - seconds\n * @param {array} [center] - Manually set the center, defaults to (0,0,0)\n ",
"range": [
259,
501
],
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 21,
"column": 7
}
}
}
],
"trailingComments": [
{
"type": "Block",
"value": "*\n *\n * @returns {number}\n ",
"range": [
926,
969
],
"loc": {
"start": {
"line": 40,
"column": 4
},
"end": {
"line": 43,
"column": 7
}
}
}
],
"static": false
},
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "getHalfLife",
"range": [
974,
985
],
"loc": {
"start": {
"line": 44,
"column": 4
},
"end": {
"line": 44,
"column": 15
}
}
},
"value": {
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ReturnStatement",
"argument": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
1005,
1009
],
"loc": {
"start": {
"line": 45,
"column": 15
},
"end": {
"line": 45,
"column": 19
}
}
},
"property": {
"type": "Identifier",
"name": "_halfLife",
"range": [
1010,
1019
],
"loc": {
"start": {
"line": 45,
"column": 20
},
"end": {
"line": 45,
"column": 29
}
}
},
"range": [
1005,
1019
],
"loc": {
"start": {
"line": 45,
"column": 15
},
"end": {
"line": 45,
"column": 29
}
}
},
"range": [
998,
1020
],
"loc": {
"start": {
"line": 45,
"column": 8
},
"end": {
"line": 45,
"column": 30
}
}
}
],
"range": [
988,
1026
],
"loc": {
"start": {
"line": 44,
"column": 18
},
"end": {
"line": 46,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
985,
1026
],
"loc": {
"start": {
"line": 44,
"column": 15
},
"end": {
"line": 46,
"column": 5
}
}
},
"kind": "method",
"computed": false,
"range": [
974,
1026
],
"loc": {
"start": {
"line": 44,
"column": 4
},
"end": {
"line": 46,
"column": 5
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n *\n * @returns {number}\n ",
"range": [
926,
969
],
"loc": {
"start": {
"line": 40,
"column": 4
},
"end": {
"line": 43,
"column": 7
}
}
}
],
"trailingComments": [
{
"type": "Block",
"value": "*\n * Read URAaTM pg 281 - 285\n * @see https://books.google.com/books?id=bCjRtBX0MYkC&pg=PA280&lpg=PA280&dq=gaussian+decay+plume&source=bl&ots=oJbqk8OmIe&sig=GqzwcwVfbk_XUR6RztjSeVI0J20&hl=en&sa=X&ved=0ahUKEwih4OS7zpTNAhWq5oMKHeM_DyIQ6AEINjAF#v=onepage&q=gaussian%20decay%20plume&f=false\n * @param {number} x - downwind distance (m)\n * @param {number} windSpeed - at source height (m/s)\n * @returns {number} Decay term\n ",
"range": [
1032,
1479
],
"loc": {
"start": {
"line": 48,
"column": 4
},
"end": {
"line": 54,
"column": 7
}
}
}
],
"static": false
},
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "getDecayTerm",
"range": [
1484,
1496
],
"loc": {
"start": {
"line": 55,
"column": 4
},
"end": {
"line": 55,
"column": 16
}
}
},
"value": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "x",
"range": [
1497,
1498
],
"loc": {
"start": {
"line": 55,
"column": 17
},
"end": {
"line": 55,
"column": 18
}
}
},
{
"type": "Identifier",
"name": "windSpeed",
"range": [
1500,
1509
],
"loc": {
"start": {
"line": 55,
"column": 20
},
"end": {
"line": 55,
"column": 29
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "IfStatement",
"test": {
"type": "BinaryExpression",
"operator": "==",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
1525,
1529
],
"loc": {
"start": {
"line": 56,
"column": 12
},
"end": {
"line": 56,
"column": 16
}
}
},
"property": {
"type": "Identifier",
"name": "_decayCoeff",
"range": [
1530,
1541
],
"loc": {
"start": {
"line": 56,
"column": 17
},
"end": {
"line": 56,
"column": 28
}
}
},
"range": [
1525,
1541
],
"loc": {
"start": {
"line": 56,
"column": 12
},
"end": {
"line": 56,
"column": 28
}
}
},
"right": {
"type": "Literal",
"value": 0,
"raw": "0",
"range": [
1545,
1546
],
"loc": {
"start": {
"line": 56,
"column": 32
},
"end": {
"line": 56,
"column": 33
}
}
},
"range": [
1525,
1546
],
"loc": {
"start": {
"line": 56,
"column": 12
},
"end": {
"line": 56,
"column": 33
}
}
},
"consequent": {
"type": "BlockStatement",
"body": [
{
"type": "ReturnStatement",
"argument": {
"type": "Literal",
"value": 1,
"raw": "1",
"range": [
1569,
1570
],
"loc": {
"start": {
"line": 57,
"column": 19
},
"end": {
"line": 57,
"column": 20
}
}
},
"range": [
1562,
1571
],
"loc": {
"start": {
"line": 57,
"column": 12
},
"end": {
"line": 57,
"column": 21
}
}
}
],
"range": [
1548,
1581
],
"loc": {
"start": {
"line": 56,
"column": 35
},
"end": {
"line": 58,
"column": 9
}
}
},
"alternate": {
"type": "BlockStatement",
"body": [
{
"type": "ReturnStatement",
"argument": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "Math",
"range": [
1608,
1612
],
"loc": {
"start": {
"line": 59,
"column": 19
},
"end": {
"line": 59,
"column": 23
}
}
},
"property": {
"type": "Identifier",
"name": "exp",
"range": [
1613,
1616
],
"loc": {
"start": {
"line": 59,
"column": 24
},
"end": {
"line": 59,
"column": 27
}
}
},
"range": [
1608,
1616
],
"loc": {
"start": {
"line": 59,
"column": 19
},
"end": {
"line": 59,
"column": 27
}
}
},
"arguments": [
{
"type": "BinaryExpression",
"operator": "*",
"left": {
"type": "UnaryExpression",
"operator": "-",
"argument": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
1619,
1623
],
"loc": {
"start": {
"line": 59,
"column": 30
},
"end": {
"line": 59,
"column": 34
}
}
},
"property": {
"type": "Identifier",
"name": "_decayCoeff",
"range": [
1624,
1635
],
"loc": {
"start": {
"line": 59,
"column": 35
},
"end": {
"line": 59,
"column": 46
}
}
},
"range": [
1619,
1635
],
"loc": {
"start": {
"line": 59,
"column": 30
},
"end": {
"line": 59,
"column": 46
}
}
},
"prefix": true,
"range": [
1617,
1635
],
"loc": {
"start": {
"line": 59,
"column": 28
},
"end": {
"line": 59,
"column": 46
}
}
},
"right": {
"type": "BinaryExpression",
"operator": "/",
"left": {
"type": "Identifier",
"name": "x",
"range": [
1639,
1640
],
"loc": {
"start": {
"line": 59,
"column": 50
},
"end": {
"line": 59,
"column": 51
}
}
},
"right": {
"type": "Identifier",
"name": "windSpeed",
"range": [
1643,
1652
],
"loc": {
"start": {
"line": 59,
"column": 54
},
"end": {
"line": 59,
"column": 63
}
}
},
"range": [
1639,
1652
],
"loc": {
"start": {
"line": 59,
"column": 50
},
"end": {
"line": 59,
"column": 63
}
}
},
"range": [
1617,
1653
],
"loc": {
"start": {
"line": 59,
"column": 28
},
"end": {
"line": 59,
"column": 64
}
}
}
],
"range": [
1608,
1654
],
"loc": {
"start": {
"line": 59,
"column": 19
},
"end": {
"line": 59,
"column": 65
}
}
},
"range": [
1601,
1655
],
"loc": {
"start": {
"line": 59,
"column": 12
},
"end": {
"line": 59,
"column": 66
}
}
}
],
"range": [
1587,
1665
],
"loc": {
"start": {
"line": 58,
"column": 15
},
"end": {
"line": 60,
"column": 9
}
}
},
"range": [
1521,
1665
],
"loc": {
"start": {
"line": 56,
"column": 8
},
"end": {
"line": 60,
"column": 9
}
}
}
],
"range": [
1511,
1671