Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DALSim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Environments
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Thibaut DEMARE
DALSim
Commits
ad0f7d39
Commit
ad0f7d39
authored
Oct 24, 2019
by
ThibautDemare
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add reflex to automatically save state of simulations (protection against breakdown on server)
parent
e44be93c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
models/Experiments.gaml
models/Experiments.gaml
+26
-0
No files found.
models/Experiments.gaml
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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment