-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathprimitive-stock-flow.ts
More file actions
68 lines (66 loc) · 2.31 KB
/
Copy pathprimitive-stock-flow.ts
File metadata and controls
68 lines (66 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { ThCategoryLinks } from "catlog-wasm";
import { Theory, type TheoryMeta } from "../../theory";
import * as analyses from "../analyses";
import styles from "../styles.module.css";
import svgStyles from "../svg_styles.module.css";
export default function createPrimitiveStockFlowTheory(theoryMeta: TheoryMeta): Theory {
const thCategoryLinks = new ThCategoryLinks();
return new Theory({
...theoryMeta,
theory: thCategoryLinks.theory(),
inclusions: ["primitive-signed-stock-flow"],
onlyFreeModels: true,
modelTypes: [
{
tag: "ObType",
obType: { tag: "Basic", content: "Object" },
name: "Stock",
description: "Thing with an amount",
shortcut: ["S"],
cssClasses: [styles.box],
svgClasses: [svgStyles.box],
},
{
tag: "MorType",
morType: {
tag: "Hom",
content: { tag: "Basic", content: "Object" },
},
name: "Flow",
description: "Flow from one stock to another",
shortcut: ["F"],
arrowStyle: "double",
},
{
tag: "MorType",
morType: { tag: "Basic", content: "Link" },
name: "Link",
description: "Influence of a stock on a flow",
preferUnnamed: true,
shortcut: ["L"],
},
],
modelAnalyses: [
analyses.stockFlowDiagram({
id: "diagram",
name: "Visualization",
description: "Visualize the stock and flow diagram",
help: "visualization",
}),
analyses.massAction({
id: "mass-action",
ratesHaveGranularity: false,
transitionType: {
tag: "Hom",
content: { tag: "Basic", content: "Object" },
},
}),
analyses.massActionEquations({
ratesHaveGranularity: false,
getEquations(model, data) {
return thCategoryLinks.massActionEquations(model, data);
},
}),
],
});
}