UNPKG

dirtybomb

Version:
1,540 lines 160 kB
{ "type": "Program", "body": [ { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportDefaultSpecifier", "local": { "type": "Identifier", "name": "GaussianPuff", "range": [ 48, 60 ], "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 19 } } }, "range": [ 48, 60 ], "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 19 } } } ], "source": { "type": "Literal", "value": "./GaussianPuff", "raw": "'./GaussianPuff'", "range": [ 66, 82 ], "loc": { "start": { "line": 5, "column": 25 }, "end": { "line": 5, "column": 41 } } }, "range": [ 41, 83 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 42 } }, "leadingComments": [ { "type": "Block", "value": "*\n * Created by austin on 6/8/16.\n ", "range": [ 0, 39 ], "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 3, "column": 3 } } } ], "trailingComments": [ { "type": "Block", "value": "*\n * Adds decay to the Simple Gaussian Puff\n ", "range": [ 85, 134 ], "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 9, "column": 3 } } } ] }, { "type": "Identifier", "id": { "type": "Identifier", "name": "GaussianDecayPuff", "range": [ 141, 158 ], "loc": { "start": { "line": 10, "column": 6 }, "end": { "line": 10, "column": 23 } } }, "superClass": { "type": "Identifier", "name": "GaussianPuff", "range": [ 167, 179 ], "loc": { "start": { "line": 10, "column": 32 }, "end": { "line": 10, "column": 44 } } }, "body": { "type": "ClassBody", "body": [ { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "constructor", "range": [ 355, 366 ], "loc": { "start": { "line": 18, "column": 4 }, "end": { "line": 18, "column": 15 } } }, "value": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "atmosphere", "range": [ 367, 377 ], "loc": { "start": { "line": 18, "column": 16 }, "end": { "line": 18, "column": 26 } } }, { "type": "Identifier", "name": "source", "range": [ 379, 385 ], "loc": { "start": { "line": 18, "column": 28 }, "end": { "line": 18, "column": 34 } } }, { "type": "Identifier", "name": "massReleased", "range": [ 387, 399 ], "loc": { "start": { "line": 18, "column": 36 }, "end": { "line": 18, "column": 48 } } }, { "type": "Identifier", "name": "halfLife", "range": [ 401, 409 ], "loc": { "start": { "line": 18, "column": 50 }, "end": { "line": 18, "column": 58 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Super", "range": [ 421, 426 ], "loc": { "start": { "line": 19, "column": 8 }, "end": { "line": 19, "column": 13 } } }, "arguments": [ { "type": "Identifier", "name": "atmosphere", "range": [ 427, 437 ], "loc": { "start": { "line": 19, "column": 14 }, "end": { "line": 19, "column": 24 } } }, { "type": "Identifier", "name": "source", "range": [ 439, 445 ], "loc": { "start": { "line": 19, "column": 26 }, "end": { "line": 19, "column": 32 } } }, { "type": "Identifier", "name": "massReleased", "range": [ 447, 459 ], "loc": { "start": { "line": 19, "column": 34 }, "end": { "line": 19, "column": 46 } } } ], "range": [ 421, 460 ], "loc": { "start": { "line": 19, "column": 8 }, "end": { "line": 19, "column": 47 } } }, "range": [ 421, 461 ], "loc": { "start": { "line": 19, "column": 8 }, "end": { "line": 19, "column": 48 } }, "trailingComments": [ { "type": "Block", "value": "*\n *\n * @type {number}\n * @private\n ", "range": [ 471, 543 ], "loc": { "start": { "line": 21, "column": 8 }, "end": { "line": 25, "column": 11 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 552, 556 ], "loc": { "start": { "line": 26, "column": 8 }, "end": { "line": 26, "column": 12 } } }, "property": { "type": "Identifier", "name": "_halfLife", "range": [ 557, 566 ], "loc": { "start": { "line": 26, "column": 13 }, "end": { "line": 26, "column": 22 } } }, "range": [ 552, 566 ], "loc": { "start": { "line": 26, "column": 8 }, "end": { "line": 26, "column": 22 } } }, "right": { "type": "Identifier", "name": "halfLife", "range": [ 569, 577 ], "loc": { "start": { "line": 26, "column": 25 }, "end": { "line": 26, "column": 33 } } }, "range": [ 552, 577 ], "loc": { "start": { "line": 26, "column": 8 }, "end": { "line": 26, "column": 33 } } }, "range": [ 552, 578 ], "loc": { "start": { "line": 26, "column": 8 }, "end": { "line": 26, "column": 34 } }, "leadingComments": [ { "type": "Block", "value": "*\n *\n * @type {number}\n * @private\n ", "range": [ 471, 543 ], "loc": { "start": { "line": 21, "column": 8 }, "end": { "line": 25, "column": 11 } } } ], "trailingComments": [ { "type": "Line", "value": " Usually the half-life of the pollutant", "range": [ 579, 620 ], "loc": { "start": { "line": 26, "column": 35 }, "end": { "line": 26, "column": 76 } } }, { "type": "Block", "value": "*\n * \n * @type {number}\n * @private\n ", "range": [ 630, 703 ], "loc": { "start": { "line": 28, "column": 8 }, "end": { "line": 32, "column": 11 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 712, 716 ], "loc": { "start": { "line": 33, "column": 8 }, "end": { "line": 33, "column": 12 } } }, "property": { "type": "Identifier", "name": "_decayCoeff", "range": [ 717, 728 ], "loc": { "start": { "line": 33, "column": 13 }, "end": { "line": 33, "column": 24 } } }, "range": [ 712, 728 ], "loc": { "start": { "line": 33, "column": 8 }, "end": { "line": 33, "column": 24 } } }, "right": { "type": "BinaryExpression", "operator": "/", "left": { "type": "Literal", "value": 0.693, "raw": "0.693", "range": [ 731, 736 ], "loc": { "start": { "line": 33, "column": 27 }, "end": { "line": 33, "column": 32 } } }, "right": { "type": "Identifier", "name": "halfLife", "range": [ 739, 747 ], "loc": { "start": { "line": 33, "column": 35 }, "end": { "line": 33, "column": 43 } } }, "range": [ 731, 747 ], "loc": { "start": { "line": 33, "column": 27 }, "end": { "line": 33, "column": 43 } } }, "range": [ 712, 747 ], "loc": { "start": { "line": 33, "column": 8 }, "end": { "line": 33, "column": 43 } } }, "range": [ 712, 748 ], "loc": { "start": { "line": 33, "column": 8 }, "end": { "line": 33, "column": 44 } }, "leadingComments": [ { "type": "Line", "value": " Usually the half-life of the pollutant", "range": [ 579, 620 ], "loc": { "start": { "line": 26, "column": 35 }, "end": { "line": 26, "column": 76 } } }, { "type": "Block", "value": "*\n * \n * @type {number}\n * @private\n ", "range": [ 630, 703 ], "loc": { "start": { "line": 28, "column": 8 }, "end": { "line": 32, "column": 11 } } } ] } ], "range": [ 411, 754 ], "loc": { "start": { "line": 18, "column": 60 }, "end": { "line": 34, "column": 5 } } }, "generator": false, "expression": false, "range": [ 366, 754 ], "loc": { "start": { "line": 18, "column": 15 }, "end": { "line": 34, "column": 5 } } }, "kind": "constructor", "computed": false, "range": [ 355, 754 ], "loc": { "start": { "line": 18, "column": 4 }, "end": { "line": 34, "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 ", "range": [ 186, 350 ], "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 17, "column": 7 } } } ], "trailingComments": [ { "type": "Block", "value": "*\n *\n * @returns {number}\n ", "range": [ 760, 803 ], "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 39, "column": 7 } } } ], "static": false }, { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "halfLife", "range": [ 812, 820 ], "loc": { "start": { "line": 40, "column": 8 }, "end": { "line": 40, "column": 16 } } }, "value": { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 840, 844 ], "loc": { "start": { "line": 41, "column": 15 }, "end": { "line": 41, "column": 19 } } }, "property": { "type": "Identifier", "name": "_halfLife", "range": [ 845, 854 ], "loc": { "start": { "line": 41, "column": 20 }, "end": { "line": 41, "column": 29 } } }, "range": [ 840, 854 ], "loc": { "start": { "line": 41, "column": 15 }, "end": { "line": 41, "column": 29 } } }, "range": [ 833, 855 ], "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 41, "column": 30 } } } ], "range": [ 823, 861 ], "loc": { "start": { "line": 40, "column": 19 }, "end": { "line": 42, "column": 5 } } }, "generator": false, "expression": false, "range": [ 820, 861 ], "loc": { "start": { "line": 40, "column": 16 }, "end": { "line": 42, "column": 5 } } }, "kind": "get", "computed": false, "range": [ 808, 861 ], "loc": { "start": { "line": 40, "column": 4 }, "end": { "line": 42, "column": 5 } }, "leadingComments": [ { "type": "Block", "value": "*\n *\n * @returns {number}\n ", "range": [ 760, 803 ], "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 39, "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": [ 867, 1314 ], "loc": { "start": { "line": 44, "column": 4 }, "end": { "line": 50, "column": 7 } } } ], "static": false }, { "type": "MethodDefinition", "key": { "type": "Identifier", "name": "getDecayTerm", "range": [ 1319, 1331 ], "loc": { "start": { "line": 51, "column": 4 }, "end": { "line": 51, "column": 16 } } }, "value": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "x", "range": [ 1332, 1333 ], "loc": { "start": { "line": 51, "column": 17 }, "end": { "line": 51, "column": 18 } } }, { "type": "Identifier", "name": "windSpeed", "range": [ 1335, 1344 ], "loc": { "start": { "line": 51, "column": 20 }, "end": { "line": 51, "column": 29 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "IfStatement", "test": { "type": "BinaryExpression", "operator": "==", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1360, 1364 ], "loc": { "start": { "line": 52, "column": 12 }, "end": { "line": 52, "column": 16 } } }, "property": { "type": "Identifier", "name": "_decayCoeff", "range": [ 1365, 1376 ], "loc": { "start": { "line": 52, "column": 17 }, "end": { "line": 52, "column": 28 } } }, "range": [ 1360, 1376 ], "loc": { "start": { "line": 52, "column": 12 }, "end": { "line": 52, "column": 28 } } }, "right": { "type": "Literal", "value": 0, "raw": "0", "range": [ 1380, 1381 ], "loc": { "start": { "line": 52, "column": 32 }, "end": { "line": 52, "column": 33 } } }, "range": [ 1360, 1381 ], "loc": { "start": { "line": 52, "column": 12 }, "end": { "line": 52, "column": 33 } } }, "consequent": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "Literal", "value": 1, "raw": "1", "range": [ 1404, 1405 ], "loc": { "start": { "line": 53, "column": 19 }, "end": { "line": 53, "column": 20 } } }, "range": [ 1397, 1406 ], "loc": { "start": { "line": 53, "column": 12 }, "end": { "line": 53, "column": 21 } } } ], "range": [ 1383, 1416 ], "loc": { "start": { "line": 52, "column": 35 }, "end": { "line": 54, "column": 9 } } }, "alternate": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Math", "range": [ 1443, 1447 ], "loc": { "start": { "line": 55, "column": 19 }, "end": { "line": 55, "column": 23 } } }, "property": { "type": "Identifier", "name": "exp", "range": [ 1448, 1451 ], "loc": { "start": { "line": 55, "column": 24 }, "end": { "line": 55, "column": 27 } } }, "range": [ 1443, 1451 ], "loc": { "start": { "line": 55, "column": 19 }, "end": { "line": 55, "column": 27 } } }, "arguments": [ { "type": "BinaryExpression", "operator": "*", "left": { "type": "UnaryExpression", "operator": "-", "argument": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1454, 1458 ], "loc": { "start": { "line": 55, "column": 30 }, "end": { "line": 55, "column": 34 } } }, "property": { "type": "Identifier", "name": "_decayCoeff", "range": [ 1459, 1470 ], "loc": { "start": { "line": 55, "column": 35 }, "end": { "line": 55, "column": 46 } } }, "range": [ 1454, 1470 ], "loc": { "start": { "line": 55, "column": 30 }, "end": { "line": 55, "column": 46 } } }, "prefix": true, "range": [ 1452, 1470 ], "loc": { "start": { "line": 55, "column": 28 }, "end": { "line": 55, "column": 46 } } }, "right": { "type": "BinaryExpression", "operator": "/", "left": { "type": "Identifier", "name": "x", "range": [ 1474, 1475 ], "loc": { "start": { "line": 55, "column": 50 }, "end": { "line": 55, "column": 51 } } }, "right": { "type": "Identifier", "name": "windSpeed", "range": [ 1478, 1487 ], "loc": { "start": { "line": 55, "column": 54 }, "end": { "line": 55, "column": 63 } } }, "range": [ 1474, 1487 ], "loc": { "start": { "line": 55, "column": 50 }, "end": { "line": 55, "column": 63 } } }, "range": [ 1452, 1488 ], "loc": { "start": { "line": 55, "column": 28 }, "end": { "line": 55, "column": 64 } } } ], "range": [ 1443, 1489 ], "loc": { "start": { "line": 55, "column": 19 }, "end": { "line": 55, "column": 65 } } }, "range": [ 1436, 1490 ], "loc": { "start": { "line": 55, "column": 12 }, "end": { "line": 55, "column": 66 } } } ], "range": [ 1422, 1500 ], "loc": { "start": { "line": 54, "column": 15 }, "end": { "line": 56, "column": 9 } } }, "range": [ 1356, 1500 ], "loc": { "start": { "line": 52, "column": 8 }, "end": { "line": 56, "column": 9 } } } ], "range": [ 1346, 1506 ], "loc": { "start": { "line": 51, "column": 31 }, "end": { "line": 57, "column": 5 } } }, "generator": false, "expression": false, "range": [ 1331, 1506 ], "loc": { "start": { "line": 51, "column": 16 }, "end": { "line": 57, "column": 5 } } }, "kind": "method", "computed": false, "range": [ 1319, 1506 ], "loc": { "start": { "line": 51, "column": 4 }, "end": { "line": 57, "column": 5 } }, "leadingComments": [ { "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+