Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pydtnsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
discus
pydtnsim
Commits
dc359a71
Commit
dc359a71
authored
2 years ago
by
ArktikHunter
Browse files
Options
Downloads
Patches
Plain Diff
put batches in gui2
parent
53389ef0
No related branches found
Branches containing commit
No related tags found
1 merge request
!21
pydtn agkmeans and version 1.0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/example2.py
+7
-7
7 additions, 7 deletions
examples/example2.py
examples/gui2.py
+7
-1
7 additions, 1 deletion
examples/gui2.py
with
14 additions
and
8 deletions
examples/example2.py
+
7
−
7
View file @
dc359a71
...
...
@@ -61,7 +61,7 @@ def main(args):
gui
.
title
(
"
Pydtnsim
"
)
if
args
[
"
config
"
]:
gui
.
lo
ad_config
(
args
[
"
config
"
])
gui
.
re
ad_config
(
args
[
"
config
"
])
gui
.
mainloop
()
config
=
gui
.
param
...
...
@@ -110,11 +110,12 @@ def main(args):
print
(
"
sim running, please wait :)
"
)
start
=
time
.
time
()
for
stats
in
pool
.
imap_unordered
(
run_simulation
,
simulations
):
type
=
stats
[
"
node_type
"
]
if
type
not
in
results
:
results
[
type
]
=
[]
results
[
type
].
append
(
stats
)
for
_
in
range
(
config
[
"
SimOptions
"
][
"
batch
"
]):
for
stats
in
pool
.
imap_unordered
(
run_simulation
,
simulations
):
type
=
stats
[
"
node_type
"
]
if
type
not
in
results
:
results
[
type
]
=
[]
results
[
type
].
append
(
stats
)
end
=
time
.
time
()
print
(
"
sim runtime:
"
,
end
-
start
)
...
...
@@ -178,7 +179,6 @@ def parse_args(args):
"
--config
"
,
"
-c
"
,
help
=
"
config file to read from
"
,
# default="config.yaml",
)
args
=
parser
.
parse_args
(
args
)
return
vars
(
args
)
...
...
This diff is collapsed.
Click to expand it.
examples/gui2.py
+
7
−
1
View file @
dc359a71
...
...
@@ -62,10 +62,13 @@ class SimOptions(tk.LabelFrame):
self
.
out_var
=
tk
.
StringVar
()
tk
.
Entry
(
self
,
textvariable
=
self
.
out_var
).
grid
(
row
=
2
,
column
=
1
)
# seeds
tk
.
Label
(
self
,
text
=
"
Seeds:
"
).
grid
(
row
=
3
,
column
=
0
)
self
.
seeds_var
=
tk
.
StringVar
()
tk
.
Entry
(
self
,
textvariable
=
self
.
seeds_var
).
grid
(
row
=
3
,
column
=
1
)
tk
.
Label
(
self
,
text
=
"
Batches:
"
).
grid
(
row
=
4
,
column
=
0
)
self
.
batch_var
=
tk
.
IntVar
(
value
=
1
)
tk
.
Entry
(
self
,
textvariable
=
self
.
batch_var
).
grid
(
row
=
4
,
column
=
1
)
def
getOptions
(
self
):
"""
Return a dictionary of sim options
"""
...
...
@@ -79,6 +82,7 @@ class SimOptions(tk.LabelFrame):
for
seed
in
self
.
seeds_var
.
get
().
split
(
"
,
"
)
if
seed
!=
""
]
param
[
"
batch
"
]
=
self
.
batch_var
.
get
()
return
param
...
...
@@ -89,6 +93,8 @@ class SimOptions(tk.LabelFrame):
tmp
=
"
,
"
.
join
(
str
(
i
)
for
i
in
options
[
"
seeds
"
])
self
.
seeds_var
.
set
(
tmp
)
self
.
batch_var
.
set
(
options
[
"
batch
"
])
class
NodeOptions
(
tk
.
LabelFrame
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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