Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DALSim
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thibaut DEMARE
DALSim
Commits
ad0f7d39
Commit
ad0f7d39
authored
5 years ago
by
ThibautDemare
Browse files
Options
Downloads
Patches
Plain Diff
Add reflex to automatically save state of simulations (protection against breakdown on server)
parent
e44be93c
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
models/Experiments.gaml
+26
-0
26 additions, 0 deletions
models/Experiments.gaml
with
26 additions
and
0 deletions
models/Experiments.gaml
+
26
−
0
View file @
ad0f7d39
...
...
@@ -53,6 +53,14 @@ global {
i <- i + 1;
}
}
action backupSim {
if(cycle mod 100 = 0 ){
write "================ START SAVE SIMULATION - " + cycle;
write "Save of simulation : " + save_simulation("backup_simu_"+cycle+".gsim");
write "================ END SAVE SIMULATION - " + cycle;
}
}
}
experiment 'Docker' type: gui {
...
...
@@ -63,6 +71,12 @@ experiment 'Docker' type: gui {
parameter "savedSteps" var: savedSteps <- [];
parameter "saveAgents" var: saveAgents <- false;
parameter "savedAgents" var: savedAgents <- [];
reflex reflexBackup {
ask world {
do backupSim;
}
}
}
experiment 'Docker from previous simulation' type: gui {
...
...
@@ -78,6 +92,12 @@ experiment 'Docker from previous simulation' type: gui {
action _init_ {
create simulation from: saved_simulation_file(pathPreviousSim);
}
reflex reflexBackup {
ask world {
do backupSim;
}
}
}
experiment 'Docker with traffic screenshots' type: gui {
...
...
@@ -89,6 +109,12 @@ experiment 'Docker with traffic screenshots' type: gui {
parameter "saveAgents" var: saveAgents <- false;
parameter "savedAgents" var: savedAgents <- [];
reflex reflexBackup {
ask world {
do backupSim;
}
}
output {
// The size of these two displays is due to the size of the calc I apply on the snapshots when I generate a video
display 'Road traffic' autosave:{1061,988} refresh:every(1) {
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment