Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Ahmad Reza Cheraghi
swarm-sim
Commits
0239857c
Commit
0239857c
authored
Apr 03, 2019
by
Ahmad Reza Cheraghi
Browse files
Update multiple.py
parent
462ca969
Changes
1
Hide whitespace changes
Inline
Side-by-side
multiple.py
View file @
0239857c
...
...
@@ -5,8 +5,8 @@ from datetime import datetime
def
main
(
argv
):
max_round
=
100
seedvalue
=
5
max_round
=
100
0
seedvalue
=
3
nTime
=
datetime
.
utcnow
().
strftime
(
'%Y-%m-%d %H:%M:%S'
)[:
-
1
]
try
:
opts
,
args
=
getopt
.
getopt
(
argv
,
"hs:w:r:n:v:"
,
[
"scenaro="
,
"solution="
])
...
...
@@ -25,14 +25,16 @@ def main(argv):
seedvalue
=
int
(
arg
)
elif
opt
in
(
"-n"
,
"--maxrounds"
):
max_round
=
int
(
arg
)
round
=
1
for
seed
in
range
(
1
,
seedvalue
+
1
):
subprocess
.
call
([
"python3.6"
,
"run.py"
,
"-n"
+
str
(
max_round
),
"-m 1"
,
"-d"
+
str
(
nTime
),
"-r"
+
str
(
seed
),
"-v 0"
]
)
subprocess
.
call
([
"python3.6"
,
"run.py"
,
"-n"
+
str
(
max_round
),
"-m 1"
,
"-d"
+
str
(
nTime
),
"-r"
+
str
(
seed
),
"-v"
+
str
(
0
)]
)
print
(
"Round Nr. "
,
round
,
"finished"
)
round
+=
1
fout
=
open
(
"./outputs/mulitple/"
+
str
(
nTime
)
+
"/all_aggregates.csv"
,
"
a
"
)
fout
=
open
(
"./outputs/mulitple/"
+
str
(
nTime
)
+
"/all_aggregates.csv"
,
"
w+
"
)
# first file:
for
line
in
open
(
"./outputs/mulitple/"
+
str
(
nTime
)
+
"/"
+
str
(
1
)
+
"/aggregate_rounds.csv"
):
fout
.
write
(
line
)
...
...
Write
Preview
Supports
Markdown
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