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
f74adbb2
Commit
f74adbb2
authored
Apr 07, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
main script to pass the environment as argument
parent
4f304d49
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
9 deletions
+10
-9
dream/simulation/CoreObject.py
dream/simulation/CoreObject.py
+2
-1
dream/simulation/Exit.py
dream/simulation/Exit.py
+2
-2
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+2
-2
dream/simulation/Queue.py
dream/simulation/Queue.py
+2
-2
dream/simulation/Source.py
dream/simulation/Source.py
+2
-2
No files found.
dream/simulation/CoreObject.py
View file @
f74adbb2
...
@@ -35,8 +35,9 @@ from ManPyObject import ManPyObject
...
@@ -35,8 +35,9 @@ from ManPyObject import ManPyObject
class
CoreObject
(
ManPyObject
):
class
CoreObject
(
ManPyObject
):
class_name
=
'Dream.CoreObject'
class_name
=
'Dream.CoreObject'
def
__init__
(
self
,
id
,
name
,
**
kw
):
def
__init__
(
self
,
environment
,
id
,
name
,
**
kw
):
ManPyObject
.
__init__
(
self
,
id
,
name
)
ManPyObject
.
__init__
(
self
,
id
,
name
)
self
.
environment
=
environment
self
.
objName
=
name
self
.
objName
=
name
# lists that hold the previous and next objects in the flow
# lists that hold the previous and next objects in the flow
self
.
next
=
[]
#list with the next objects in the flow
self
.
next
=
[]
#list with the next objects in the flow
...
...
dream/simulation/Exit.py
View file @
f74adbb2
...
@@ -37,15 +37,15 @@ class Exit(CoreObject):
...
@@ -37,15 +37,15 @@ class Exit(CoreObject):
family
=
'Exit'
family
=
'Exit'
def
__init__
(
self
,
id
,
name
,
cancelCondition
=
{},
**
kw
):
def
__init__
(
self
,
environment
,
id
,
name
,
cancelCondition
=
{},
**
kw
):
self
.
type
=
"Exit"
# XXX needed ?
self
.
type
=
"Exit"
# XXX needed ?
CoreObject
.
__init__
(
self
,
environment
,
id
,
name
)
#lists to hold statistics of multiple runs
#lists to hold statistics of multiple runs
self
.
Exits
=
[]
self
.
Exits
=
[]
self
.
UnitExits
=
[]
self
.
UnitExits
=
[]
self
.
Lifespan
=
[]
self
.
Lifespan
=
[]
self
.
TaktTime
=
[]
self
.
TaktTime
=
[]
# if input is given in a dictionary
# if input is given in a dictionary
CoreObject
.
__init__
(
self
,
id
,
name
)
self
.
cancelCondition
=
cancelCondition
self
.
cancelCondition
=
cancelCondition
def
initialize
(
self
):
def
initialize
(
self
):
...
...
dream/simulation/LineGenerationJSON.py
View file @
f74adbb2
...
@@ -217,9 +217,9 @@ def createObjectResourcesAndCoreObjects(environment,json_data):
...
@@ -217,9 +217,9 @@ def createObjectResourcesAndCoreObjects(environment,json_data):
if
issubclass
(
objectType
,
CoreObject
):
if
issubclass
(
objectType
,
CoreObject
):
# remove data that has to do with wip or object interruption. CoreObjects do not need it
# remove data that has to do with wip or object interruption. CoreObjects do not need it
inputDict
=
dict
(
element
)
inputDict
=
dict
(
element
)
inputDict
[
'environment'
]
=
environment
# create the CoreObject
# create the CoreObject
coreObject
=
objectType
(
**
inputDict
)
coreObject
=
objectType
(
**
inputDict
)
coreObject
.
environment
=
environment
environment
.
ObjList
.
append
(
coreObject
)
environment
.
ObjList
.
append
(
coreObject
)
# update the nextIDs list of the object
# update the nextIDs list of the object
coreObject
.
nextIds
=
getSuccessorList
(
element
[
'id'
])
coreObject
.
nextIds
=
getSuccessorList
(
element
[
'id'
])
...
...
dream/simulation/Queue.py
View file @
f74adbb2
...
@@ -37,10 +37,10 @@ class Queue(CoreObject):
...
@@ -37,10 +37,10 @@ class Queue(CoreObject):
#===========================================================================
#===========================================================================
# the __init__ method of the Queue
# the __init__ method of the Queue
#===========================================================================
#===========================================================================
def
__init__
(
self
,
id
=
''
,
name
=
''
,
capacity
=
1
,
isDummy
=
False
,
schedulingRule
=
"FIFO"
,
def
__init__
(
self
,
environment
,
id
=
''
,
name
=
''
,
capacity
=
1
,
isDummy
=
False
,
schedulingRule
=
"FIFO"
,
level
=
None
,
gatherWipStat
=
False
,
**
kw
):
level
=
None
,
gatherWipStat
=
False
,
**
kw
):
self
.
type
=
"Queue"
# String that shows the type of object
self
.
type
=
"Queue"
# String that shows the type of object
CoreObject
.
__init__
(
self
,
id
,
name
)
CoreObject
.
__init__
(
self
,
environment
,
id
,
name
)
capacity
=
float
(
capacity
)
capacity
=
float
(
capacity
)
if
capacity
<
0
or
capacity
==
float
(
"inf"
):
if
capacity
<
0
or
capacity
==
float
(
"inf"
):
self
.
capacity
=
float
(
"inf"
)
self
.
capacity
=
float
(
"inf"
)
...
...
dream/simulation/Source.py
View file @
f74adbb2
...
@@ -82,7 +82,7 @@ class Source(CoreObject):
...
@@ -82,7 +82,7 @@ class Source(CoreObject):
#===========================================================================
#===========================================================================
# the __init__method of the Source class
# the __init__method of the Source class
#===========================================================================
#===========================================================================
def
__init__
(
self
,
id
,
name
,
interArrivalTime
=
None
,
entity
=
'Dream.Part'
,
**
kw
):
def
__init__
(
self
,
environment
,
id
,
name
,
interArrivalTime
=
None
,
entity
=
'Dream.Part'
,
**
kw
):
# Default values
# Default values
if
not
interArrivalTime
:
if
not
interArrivalTime
:
interArrivalTime
=
{
'Fixed'
:
{
'mean'
:
1
}}
interArrivalTime
=
{
'Fixed'
:
{
'mean'
:
1
}}
...
@@ -90,7 +90,7 @@ class Source(CoreObject):
...
@@ -90,7 +90,7 @@ class Source(CoreObject):
interArrivalTime
[
'Normal'
].
get
(
'max'
,
None
)
is
None
:
interArrivalTime
[
'Normal'
].
get
(
'max'
,
None
)
is
None
:
interArrivalTime
[
'Normal'
][
'max'
]
=
interArrivalTime
[
'Normal'
][
'mean'
]
+
5
*
interArrivalTime
[
'Normal'
][
'stdev'
]
interArrivalTime
[
'Normal'
][
'max'
]
=
interArrivalTime
[
'Normal'
][
'mean'
]
+
5
*
interArrivalTime
[
'Normal'
][
'stdev'
]
CoreObject
.
__init__
(
self
,
id
,
name
)
CoreObject
.
__init__
(
self
,
environment
,
id
,
name
)
# properties used for statistics
# properties used for statistics
self
.
totalinterArrivalTime
=
0
# the total interarrival time
self
.
totalinterArrivalTime
=
0
# the total interarrival time
self
.
numberOfArrivals
=
0
# the number of entities that were created
self
.
numberOfArrivals
=
0
# the number of entities that were created
...
...
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