Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
606cf427
Commit
606cf427
authored
Aug 25, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
methods that EventGenerator calls do not need to take arguments as dicts
parent
cc5d571e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
10 deletions
+11
-10
dream/simulation/EventGenerator.py
dream/simulation/EventGenerator.py
+1
-1
dream/simulation/Globals.py
dream/simulation/Globals.py
+8
-7
dream/simulation/JSONInputs/Topology27.json
dream/simulation/JSONInputs/Topology27.json
+2
-2
No files found.
dream/simulation/EventGenerator.py
View file @
606cf427
...
@@ -56,7 +56,7 @@ class EventGenerator(ObjectInterruption):
...
@@ -56,7 +56,7 @@ class EventGenerator(ObjectInterruption):
if
self
.
stop
:
if
self
.
stop
:
if
self
.
env
.
now
>
self
.
stop
:
if
self
.
env
.
now
>
self
.
stop
:
break
break
self
.
method
(
self
.
argumentDict
)
#call the method
self
.
method
(
**
self
.
argumentDict
)
#call the method
yield
self
.
env
.
timeout
(
self
.
interval
)
#wait for the predetermined interval
yield
self
.
env
.
timeout
(
self
.
interval
)
#wait for the predetermined interval
...
...
dream/simulation/Globals.py
View file @
606cf427
...
@@ -134,11 +134,11 @@ class G:
...
@@ -134,11 +134,11 @@ class G:
# =======================================================================
# =======================================================================
# method to move entities exceeding a certain safety stock
# method to move entities exceeding a certain safety stock
# =======================================================================
# =======================================================================
def
moveExcess
(
argumentDict
=
{}
):
def
moveExcess
(
consumption
=
1
,
safetyStock
=
70
,
giverId
=
None
,
receiverId
=
None
):
giver
=
findObjectById
(
argumentDict
.
get
(
'from'
,
None
)
)
giver
=
findObjectById
(
giverId
)
receiver
=
findObjectById
(
argumentDict
.
get
(
'to'
,
None
)
)
receiver
=
findObjectById
(
receiverId
)
safetyStock
=
int
(
argumentDict
.
get
(
'safetyStock'
,
10
)
)
safetyStock
=
int
(
safetyStock
)
consumption
=
int
(
argumentDict
.
get
(
'consumption'
,
1
)
)
consumption
=
int
(
consumption
)
if
giver
and
receiver
:
if
giver
and
receiver
:
if
len
(
giver
.
getActiveObjectQueue
())
>
safetyStock
:
if
len
(
giver
.
getActiveObjectQueue
())
>
safetyStock
:
giver
.
receiver
=
receiver
giver
.
receiver
=
receiver
...
@@ -285,8 +285,9 @@ def setWIP(entityList):
...
@@ -285,8 +285,9 @@ def setWIP(entityList):
if
not
(
entity
.
currentStation
.
initialWIP
.
triggered
):
if
not
(
entity
.
currentStation
.
initialWIP
.
triggered
):
entity
.
currentStation
.
initialWIP
.
succeed
(
G
.
env
)
entity
.
currentStation
.
initialWIP
.
succeed
(
G
.
env
)
from
Exit
import
Exit
def
countIntervalThroughput
(
argumentDict
=
{}):
def
countIntervalThroughput
():
from
Exit
import
Exit
currentExited
=
0
currentExited
=
0
for
obj
in
G
.
ObjList
:
for
obj
in
G
.
ObjList
:
if
isinstance
(
obj
,
Exit
):
if
isinstance
(
obj
,
Exit
):
...
...
dream/simulation/JSONInputs/Topology27.json
View file @
606cf427
...
@@ -40,9 +40,9 @@
...
@@ -40,9 +40,9 @@
"_class"
:
"Dream.EventGenerator"
,
"_class"
:
"Dream.EventGenerator"
,
"argumentDict"
:
{
"argumentDict"
:
{
"consumption"
:
20
,
"consumption"
:
20
,
"
from
"
:
"Q2"
,
"
giverId
"
:
"Q2"
,
"safetyStock"
:
70
,
"safetyStock"
:
70
,
"
to
"
:
"E1"
"
receiverId
"
:
"E1"
},
},
"interval"
:
"60"
,
"interval"
:
"60"
,
"method"
:
"Dream.Globals.moveExcess"
,
"method"
:
"Dream.Globals.moveExcess"
,
...
...
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