Skip to content

Instantly share code, notes, and snippets.

@olekscode
Last active June 9, 2023 08:56
Show Gist options
  • Save olekscode/b981a6173059964185b21bfe8c1f6c7a to your computer and use it in GitHub Desktop.
Save olekscode/b981a6173059964185b21bfe8c1f6c7a to your computer and use it in GitHub Desktop.
Example of running a Cormas simulation in Pharo 11 without UI
"Run this in Pharo 11"
"Load Cormas without UI"
Metacello new
onConflictUseLoaded;
onWarningLog;
repository: 'github://cormas/cormas:v0.5';
baseline: 'Cormas';
load: #Core.
"Load the SEIR model"
Metacello new
onConflictUseLoaded;
baseline: 'REDModel';
repository: 'github://olekscode/REDEpidemiologicalModel';
load.
"Initialize the model"
model := REDModel new.
model initSimulation.
"Run simulation for 730 days"
(1 to: 730)
do: [ :step | model runStep ]
displayingProgress: [ :step | 'Simulation step ', step asString ].
"Inspect the model"
model inspect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment