dirtybomb
Version:
A dirty bomb model
1,559 lines (1,558 loc) • 190 kB
JSON
{
"type": "Program",
"body": [
{
"type": "Identifier",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "SourceType",
"range": [
174,
184
],
"loc": {
"start": {
"line": 10,
"column": 6
},
"end": {
"line": 10,
"column": 16
}
}
},
"init": {
"type": "ObjectExpression",
"properties": [
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "POINT",
"range": [
193,
198
],
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 11,
"column": 9
}
}
},
"value": {
"type": "Literal",
"value": "point",
"raw": "'point'",
"range": [
200,
207
],
"loc": {
"start": {
"line": 11,
"column": 11
},
"end": {
"line": 11,
"column": 18
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
193,
207
],
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 11,
"column": 18
}
}
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "VOLUME",
"range": [
213,
219
],
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 10
}
}
},
"value": {
"type": "Literal",
"value": "volume",
"raw": "'volume'",
"range": [
221,
229
],
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 20
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
213,
229
],
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 20
}
}
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "AREA",
"range": [
235,
239
],
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 13,
"column": 8
}
}
},
"value": {
"type": "Literal",
"value": "area",
"raw": "'area'",
"range": [
241,
247
],
"loc": {
"start": {
"line": 13,
"column": 10
},
"end": {
"line": 13,
"column": 16
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
235,
247
],
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 13,
"column": 16
}
}
}
],
"range": [
187,
249
],
"loc": {
"start": {
"line": 10,
"column": 19
},
"end": {
"line": 14,
"column": 1
}
}
},
"range": [
174,
249
],
"loc": {
"start": {
"line": 10,
"column": 6
},
"end": {
"line": 14,
"column": 1
}
}
}
],
"kind": "const",
"range": [
168,
250
],
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 14,
"column": 2
}
},
"leadingComments": [],
"trailingComments": [],
"name": "_"
},
{
"type": "Identifier",
"id": {
"type": "Identifier",
"name": "Source",
"range": [
304,
310
],
"loc": {
"start": {
"line": 19,
"column": 6
},
"end": {
"line": 19,
"column": 12
}
}
},
"superClass": null,
"body": {
"type": "ClassBody",
"body": [
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "constructor",
"range": [
626,
637
],
"loc": {
"start": {
"line": 30,
"column": 4
},
"end": {
"line": 30,
"column": 15
}
}
},
"value": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "type",
"range": [
638,
642
],
"loc": {
"start": {
"line": 30,
"column": 16
},
"end": {
"line": 30,
"column": 20
}
}
},
{
"type": "Identifier",
"name": "emissionRate",
"range": [
644,
656
],
"loc": {
"start": {
"line": 30,
"column": 22
},
"end": {
"line": 30,
"column": 34
}
}
},
{
"type": "Identifier",
"name": "height",
"range": [
658,
664
],
"loc": {
"start": {
"line": 30,
"column": 36
},
"end": {
"line": 30,
"column": 42
}
}
},
{
"type": "Identifier",
"name": "radius",
"range": [
666,
672
],
"loc": {
"start": {
"line": 30,
"column": 44
},
"end": {
"line": 30,
"column": 50
}
}
},
{
"type": "Identifier",
"name": "temperature",
"range": [
674,
685
],
"loc": {
"start": {
"line": 30,
"column": 52
},
"end": {
"line": 30,
"column": 63
}
}
},
{
"type": "Identifier",
"name": "exitVelocity",
"range": [
687,
699
],
"loc": {
"start": {
"line": 30,
"column": 65
},
"end": {
"line": 30,
"column": 77
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
773,
777
],
"loc": {
"start": {
"line": 35,
"column": 8
},
"end": {
"line": 35,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"name": "emissionRate",
"range": [
778,
790
],
"loc": {
"start": {
"line": 35,
"column": 13
},
"end": {
"line": 35,
"column": 25
}
}
},
"range": [
773,
790
],
"loc": {
"start": {
"line": 35,
"column": 8
},
"end": {
"line": 35,
"column": 25
}
}
},
"right": {
"type": "Identifier",
"name": "emissionRate",
"range": [
793,
805
],
"loc": {
"start": {
"line": 35,
"column": 28
},
"end": {
"line": 35,
"column": 40
}
}
},
"range": [
773,
805
],
"loc": {
"start": {
"line": 35,
"column": 8
},
"end": {
"line": 35,
"column": 40
}
}
},
"range": [
773,
806
],
"loc": {
"start": {
"line": 35,
"column": 8
},
"end": {
"line": 35,
"column": 41
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * \n * @type {number}\n ",
"range": [
711,
764
],
"loc": {
"start": {
"line": 31,
"column": 8
},
"end": {
"line": 34,
"column": 11
}
}
}
],
"trailingComments": [
{
"type": "Block",
"value": "*\n * \n * @type {number}\n ",
"range": [
815,
868
],
"loc": {
"start": {
"line": 36,
"column": 8
},
"end": {
"line": 39,
"column": 11
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
877,
881
],
"loc": {
"start": {
"line": 40,
"column": 8
},
"end": {
"line": 40,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"name": "height",
"range": [
882,
888
],
"loc": {
"start": {
"line": 40,
"column": 13
},
"end": {
"line": 40,
"column": 19
}
}
},
"range": [
877,
888
],
"loc": {
"start": {
"line": 40,
"column": 8
},
"end": {
"line": 40,
"column": 19
}
}
},
"right": {
"type": "Identifier",
"name": "height",
"range": [
891,
897
],
"loc": {
"start": {
"line": 40,
"column": 22
},
"end": {
"line": 40,
"column": 28
}
}
},
"range": [
877,
897
],
"loc": {
"start": {
"line": 40,
"column": 8
},
"end": {
"line": 40,
"column": 28
}
}
},
"range": [
877,
898
],
"loc": {
"start": {
"line": 40,
"column": 8
},
"end": {
"line": 40,
"column": 29
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * \n * @type {number}\n ",
"range": [
815,
868
],
"loc": {
"start": {
"line": 36,
"column": 8
},
"end": {
"line": 39,
"column": 11
}
}
}
],
"trailingComments": [
{
"type": "Block",
"value": "*\n * \n * @type {number}\n ",
"range": [
907,
960
],
"loc": {
"start": {
"line": 41,
"column": 8
},
"end": {
"line": 44,
"column": 11
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
969,
973
],
"loc": {
"start": {
"line": 45,
"column": 8
},
"end": {
"line": 45,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"name": "radius",
"range": [
974,
980
],
"loc": {
"start": {
"line": 45,
"column": 13
},
"end": {
"line": 45,
"column": 19
}
}
},
"range": [
969,
980
],
"loc": {
"start": {
"line": 45,
"column": 8
},
"end": {
"line": 45,
"column": 19
}
}
},
"right": {
"type": "Identifier",
"name": "radius",
"range": [
983,
989
],
"loc": {
"start": {
"line": 45,
"column": 22
},
"end": {
"line": 45,
"column": 28
}
}
},
"range": [
969,
989
],
"loc": {
"start": {
"line": 45,
"column": 8
},
"end": {
"line": 45,
"column": 28
}
}
},
"range": [
969,
990
],
"loc": {
"start": {
"line": 45,
"column": 8
},
"end": {
"line": 45,
"column": 29
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * \n * @type {number}\n ",
"range": [
907,
960
],
"loc": {
"start": {
"line": 41,
"column": 8
},
"end": {
"line": 44,
"column": 11
}
}
}
],
"trailingComments": [
{
"type": "Block",
"value": "*\n * \n * @type {SourceType}\n * @private\n ",
"range": [
999,
1076
],
"loc": {
"start": {
"line": 46,
"column": 8
},
"end": {
"line": 50,
"column": 11
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
1085,
1089
],
"loc": {
"start": {
"line": 51,
"column": 8
},
"end": {
"line": 51,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"name": "_type",
"range": [
1090,
1095
],
"loc": {
"start": {
"line": 51,
"column": 13
},
"end": {
"line": 51,
"column": 18
}
}
},
"range": [
1085,
1095
],
"loc": {
"start": {
"line": 51,
"column": 8
},
"end": {
"line": 51,
"column": 18
}
}
},
"right": {
"type": "Identifier",
"name": "type",
"range": [
1098,
1102
],
"loc": {
"start": {
"line": 51,
"column": 21
},
"end": {
"line": 51,
"column": 25
}
}
},
"range": [
1085,
1102
],
"loc": {
"start": {
"line": 51,
"column": 8
},
"end": {
"line": 51,
"column": 25
}
}
},
"range": [
1085,
1103
],
"loc": {
"start": {
"line": 51,
"column": 8
},
"end": {
"line": 51,
"column": 26
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * \n * @type {SourceType}\n * @private\n ",
"range": [
999,
1076
],
"loc": {
"start": {
"line": 46,
"column": 8
},
"end": {
"line": 50,
"column": 11
}
}
}
],
"trailingComments": [
{
"type": "Block",
"value": "*\n * \n * @type {number}\n ",
"range": [
1112,
1165
],
"loc": {
"start": {
"line": 52,
"column": 8
},
"end": {
"line": 55,
"column": 11
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
1174,
1178
],
"loc": {
"start": {
"line": 56,
"column": 8
},
"end": {
"line": 56,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"name": "_temp",
"range": [
1179,
1184
],
"loc": {
"start": {
"line": 56,
"column": 13
},
"end": {
"line": 56,
"column": 18
}
}
},
"range": [
1174,
1184
],
"loc": {
"start": {
"line": 56,
"column": 8
},
"end": {
"line": 56,
"column": 18
}
}
},
"right": {
"type": "Identifier",
"name": "temperature",
"range": [
1187,
1198
],
"loc": {
"start": {
"line": 56,
"column": 21
},
"end": {
"line": 56,
"column": 32
}
}
},
"range": [
1174,
1198
],
"loc": {
"start": {
"line": 56,
"column": 8
},
"end": {
"line": 56,
"column": 32
}
}
},
"range": [
1174,
1199
],
"loc": {
"start": {
"line": 56,
"column": 8
},
"end": {
"line": 56,
"column": 33
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * \n * @type {number}\n ",
"range": [
1112,
1165
],
"loc": {
"start": {
"line": 52,
"column": 8
},
"end": {
"line": 55,
"column": 11
}
}
}
],
"trailingComments": [
{
"type": "Block",
"value": "*\n * \n * @type {number}\n ",
"range": [
1208,
1261
],
"loc": {
"start": {
"line": 57,
"column": 8
},
"end": {
"line": 60,
"column": 11
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
1270,
1274
],
"loc": {
"start": {
"line": 61,
"column": 8
},
"end": {
"line": 61,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"name": "exitVel",
"range": [
1275,
1282
],
"loc": {
"start": {
"line": 61,
"column": 13
},
"end": {
"line": 61,
"column": 20
}
}
},
"range": [
1270,
1282
],
"loc": {
"start": {
"line": 61,
"column": 8
},
"end": {
"line": 61,
"column": 20
}
}
},
"right": {
"type": "Identifier",
"name": "exitVelocity",
"range": [
1285,
1297
],
"loc": {
"start": {
"line": 61,
"column": 23
},
"end": {
"line": 61,
"column": 35
}
}
},
"range": [
1270,
1297
],
"loc": {
"start": {
"line": 61,
"column": 8
},
"end": {
"line": 61,
"column": 35
}
}
},
"range": [
1270,
1298
],
"loc": {
"start": {
"line": 61,
"column": 8
},
"end": {
"line": 61,
"column": 36
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * \n * @type {number}\n ",
"range": [
1208,
1261
],
"loc": {
"start": {
"line": 57,
"column": 8
},
"end": {
"line": 60,
"column": 11
}
}
}
]
}
],
"range": [
701,
1304
],
"loc": {
"start": {
"line": 30,
"column": 79
},
"end": {
"line": 62,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
637,
1304
],
"loc": {
"start": {
"line": 30,
"column": 15
},
"end": {
"line": 62,
"column": 5
}
}
},
"kind": "constructor",
"computed": false,
"range": [
626,
1304
],
"loc": {
"start": {
"line": 30,
"column": 4
},
"end": {
"line": 62,
"column": 5
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * \n * @param {string} type - The type of source \n * @param {number} emissionRate - Maximum hourly emissions rate in g/s\n * @param {number} height - m\n * @param {number} radius - m\n * @param {number} temperature - Kelvin\n * @param {number} exitVelocity - m/s\n ",
"range": [
322,
621
],
"loc": {
"start": {
"line": 21,
"column": 4
},
"end": {
"line": 29,
"column": 7
}
}
}
],
"trailingComments": [
{
"type": "Block",
"value": "*\n * \n * @returns {string}\n ",
"range": [
1310,
1354
],
"loc": {
"start": {
"line": 64,
"column": 4
},
"end": {
"line": 67,
"column": 7
}
}
}
],
"static": false
},
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "toString",
"range": [
1359,
1367
],
"loc": {
"start": {
"line": 68,
"column": 4
},
"end": {
"line": 68,
"column": 12
}
}
},
"value": {
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ReturnStatement",
"argument": {
"type": "TemplateLiteral",
"quasis": [
{
"type": "TemplateElement",
"value": {
"raw": "",
"cooked": ""
},
"tail": false,
"range": [
1387,
1390
],
"loc": {
"start": {
"line": 69,
"column": 15
},
"end": {
"line": 69,
"column": 18
}
}
},
{
"type": "TemplateElement",
"value": {
"raw": ": Emission rate of ",
"cooked": ": Emission rate of "
},
"tail": false,
"range": [
1399,
1421
],
"loc": {
"start": {
"line": 69,
"column": 27
},
"end": {
"line": 69,
"column": 49
}
}
},
{
"type": "TemplateElement",
"value": {
"raw": " g/s",
"cooked": " g/s"
},
"tail": true,
"range": [
1438,
1444
],
"loc": {
"start": {
"line": 69,
"column": 66
},
"end": {
"line": 69,
"column": 72
}
}
}
],
"expressions": [
{
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
1390,
1394
],
"loc": {
"start": {
"line": 69,
"column": 18
},
"end": {
"line": 69,
"column": 22
}
}
},
"property": {
"type": "Identifier",
"name": "type",
"range": [
1395,
1399
],
"loc": {
"start": {
"line": 69,
"column": 23
},
"end": {
"line": 69,
"column": 27
}
}
},
"range": [
1390,
1399
],
"loc": {
"start": {
"line": 69,
"column": 18
},
"end": {
"line": 69,
"column": 27
}
}
},
{
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
1421,
1425
],
"loc": {
"start": {
"line": 69,
"column": 49
},
"end": {
"line": 69,
"column": 53
}
}
},
"property": {
"type": "Identifier",
"name": "emissionRate",
"range": [
1426,
1438
],
"loc": {
"start": {
"line": 69,
"column": 54
},
"end": {
"line": 69,
"column": 66
}
}
},
"range": [
1421,
1438
],
"loc": {
"start": {