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
4e6513f6
Commit
4e6513f6
authored
Dec 17, 2013
by
Georgios Dagkakis
Committed by
Jérome Perrin
Jan 20, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update so that parts can be also set as wip of Queues. Two tests also added with simple examples
parent
416957ad
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
267 additions
and
5 deletions
+267
-5
dream/simulation/Globals.py
dream/simulation/Globals.py
+7
-2
dream/simulation/JSONInputs/Topology29.json
dream/simulation/JSONInputs/Topology29.json
+80
-0
dream/simulation/JSONInputs/Topology30.json
dream/simulation/JSONInputs/Topology30.json
+92
-0
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+14
-3
dream/tests/dump/Topology29.json.result
dream/tests/dump/Topology29.json.result
+37
-0
dream/tests/dump/Topology30.json.result
dream/tests/dump/Topology30.json.result
+37
-0
No files found.
dream/simulation/Globals.py
View file @
4e6513f6
...
@@ -95,8 +95,11 @@ def findObjectById(id):
...
@@ -95,8 +95,11 @@ def findObjectById(id):
def
setWIP
(
entityList
):
def
setWIP
(
entityList
):
for
entity
in
entityList
:
for
entity
in
entityList
:
if
entity
.
type
==
'Job'
:
if
entity
.
type
==
'Part'
:
objectId
=
entity
.
currentStation
# get the id of the object where the entity currently seats
object
=
entity
.
currentStation
#identify the object
object
.
getActiveObjectQueue
().
append
(
entity
)
#append the entity to its Queue
entity
.
schedule
.
append
([
object
,
now
()])
#append the time to schedule so that it can be read in the result
elif
entity
.
type
==
'Job'
:
object
=
findObjectById
(
entity
.
remainingRoute
[
0
][
0
])
# find the object in the 'G.ObjList
object
=
findObjectById
(
entity
.
remainingRoute
[
0
][
0
])
# find the object in the 'G.ObjList
object
.
getActiveObjectQueue
().
append
(
entity
)
# append the entity to its Queue
object
.
getActiveObjectQueue
().
append
(
entity
)
# append the entity to its Queue
object
.
receiver
=
findObjectById
(
entity
.
remainingRoute
[
1
][
0
])
object
.
receiver
=
findObjectById
(
entity
.
remainingRoute
[
1
][
0
])
...
@@ -104,4 +107,6 @@ def setWIP(entityList):
...
@@ -104,4 +107,6 @@ def setWIP(entityList):
entity
.
schedule
.
append
([
object
,
now
()])
#append the time to schedule so that it can be read in the result
entity
.
schedule
.
append
([
object
,
now
()])
#append the time to schedule so that it can be read in the result
entity
.
currentStation
=
object
# update the current station of the entity
entity
.
currentStation
=
object
# update the current station of the entity
dream/simulation/JSONInputs/Topology29.json
0 → 100644
View file @
4e6513f6
{
"_class"
:
"Dream.Simulation"
,
"edges"
:
{
"0"
:
[
"M1"
,
"Q2"
,
{}
],
"1"
:
[
"M2"
,
"E1"
,
{}
],
"2"
:
[
"Q1"
,
"M1"
,
{}
],
"3"
:
[
"Q2"
,
"M2"
,
{}
]
},
"general"
:
{
"_class"
:
"Dream.Configuration"
,
"numberOfReplications"
:
"1"
,
"maxSimTime"
:
"-1"
,
"trace"
:
"Yes"
,
"confidenceLevel"
:
"0.95"
},
"nodes"
:
{
"M1"
:
{
"_class"
:
"Dream.Machine"
,
"id"
:
"M1"
,
"name"
:
"Machine1"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"0.25"
},
"failures"
:
{}
},
"M2"
:
{
"_class"
:
"Dream.Machine"
,
"id"
:
"M2"
,
"name"
:
"Machine2"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"1.5"
},
"failures"
:
{}
},
"Q1"
:
{
"_class"
:
"Dream.Queue"
,
"id"
:
"Q1"
,
"name"
:
"Queue1"
,
"isDummy"
:
"0"
,
"capacity"
:
"1"
,
"wip"
:
[
{
"_class"
:
"Dream.Part"
,
"id"
:
"P1"
,
"name"
:
"Part1"
}
]
},
"Q2"
:
{
"_class"
:
"Dream.Queue"
,
"id"
:
"Q2"
,
"name"
:
"Queue2"
,
"isDummy"
:
"0"
,
"capacity"
:
"1"
},
"E1"
:
{
"_class"
:
"Dream.Exit"
,
"id"
:
"E1"
,
"name"
:
"Stock"
}
}
}
\ No newline at end of file
dream/simulation/JSONInputs/Topology30.json
0 → 100644
View file @
4e6513f6
{
"_class"
:
"Dream.Simulation"
,
"edges"
:
{
"0"
:
[
"M1"
,
"Q2"
,
{}
],
"1"
:
[
"M2"
,
"E1"
,
{}
],
"2"
:
[
"Q1"
,
"M1"
,
{}
],
"3"
:
[
"Q2"
,
"M2"
,
{}
]
},
"general"
:
{
"_class"
:
"Dream.Configuration"
,
"numberOfReplications"
:
"1"
,
"maxSimTime"
:
"-1"
,
"trace"
:
"Yes"
,
"confidenceLevel"
:
"0.95"
},
"nodes"
:
{
"M1"
:
{
"_class"
:
"Dream.Machine"
,
"id"
:
"M1"
,
"name"
:
"Machine1"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"0.25"
},
"failures"
:
{}
},
"M2"
:
{
"_class"
:
"Dream.Machine"
,
"id"
:
"M2"
,
"name"
:
"Machine2"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"1.5"
},
"failures"
:
{}
},
"Q1"
:
{
"_class"
:
"Dream.Queue"
,
"id"
:
"Q1"
,
"name"
:
"Queue1"
,
"isDummy"
:
"0"
,
"capacity"
:
"1"
,
"wip"
:
[
{
"_class"
:
"Dream.Part"
,
"id"
:
"P1"
,
"name"
:
"Part1"
},
{
"_class"
:
"Dream.Part"
,
"id"
:
"P2"
,
"name"
:
"Part2"
}
]
},
"Q2"
:
{
"_class"
:
"Dream.Queue"
,
"id"
:
"Q2"
,
"name"
:
"Queue2"
,
"isDummy"
:
"0"
,
"capacity"
:
"1"
,
"wip"
:
[
{
"_class"
:
"Dream.Part"
,
"id"
:
"P3"
,
"name"
:
"Part3"
}
]
},
"E1"
:
{
"_class"
:
"Dream.Exit"
,
"id"
:
"E1"
,
"name"
:
"Stock"
}
}
}
\ No newline at end of file
dream/simulation/LineGenerationJSON.py
View file @
4e6513f6
...
@@ -705,6 +705,7 @@ def createWIP():
...
@@ -705,6 +705,7 @@ def createWIP():
G
.
JobList
=
[]
G
.
JobList
=
[]
G
.
WipList
=
[]
G
.
WipList
=
[]
G
.
EntityList
=
[]
G
.
EntityList
=
[]
G
.
PartList
=
[]
json_data
=
G
.
JSONData
json_data
=
G
.
JSONData
#Read the json data
#Read the json data
...
@@ -718,7 +719,7 @@ def createWIP():
...
@@ -718,7 +719,7 @@ def createWIP():
entityClass
=
entity
.
get
(
'_class'
,
None
)
entityClass
=
entity
.
get
(
'_class'
,
None
)
except
IndexError
:
except
IndexError
:
continue
continue
if
entityClass
==
'Dream.Job'
:
if
entityClass
==
'Dream.Job'
:
id
=
entity
.
get
(
'id'
,
'not found'
)
id
=
entity
.
get
(
'id'
,
'not found'
)
name
=
entity
.
get
(
'name'
,
'not found'
)
name
=
entity
.
get
(
'name'
,
'not found'
)
...
@@ -768,7 +769,17 @@ def createWIP():
...
@@ -768,7 +769,17 @@ def createWIP():
orderDate
=
orderDate
,
extraPropertyDict
=
extraPropertyDict
)
orderDate
=
orderDate
,
extraPropertyDict
=
extraPropertyDict
)
G
.
JobList
.
append
(
J
)
G
.
JobList
.
append
(
J
)
G
.
WipList
.
append
(
J
)
G
.
WipList
.
append
(
J
)
G
.
EntityList
.
append
(
J
)
G
.
EntityList
.
append
(
J
)
elif
entityClass
==
'Dream.Part'
:
id
=
entity
.
get
(
'id'
,
'not found'
)
name
=
entity
.
get
(
'name'
,
'not found'
)
P
=
Part
(
id
,
name
)
G
.
PartList
.
append
(
P
)
G
.
WipList
.
append
(
P
)
G
.
EntityList
.
append
(
P
)
object
=
Globals
.
findObjectById
(
element
[
'id'
])
P
.
currentStation
=
object
# ===========================================================================
# ===========================================================================
# used to convert a string read from the input to object type
# used to convert a string read from the input to object type
...
@@ -804,7 +815,7 @@ def main(argv=[], input_data=None):
...
@@ -804,7 +815,7 @@ def main(argv=[], input_data=None):
G
.
JSONData
=
json
.
loads
(
G
.
InputData
)
# create the dictionary JSONData
G
.
JSONData
=
json
.
loads
(
G
.
InputData
)
# create the dictionary JSONData
readGeneralInput
()
readGeneralInput
()
createObjects
()
createObjects
()
createWIP
()
#
createWIP()
setTopology
()
setTopology
()
#run the experiment (replications)
#run the experiment (replications)
...
...
dream/tests/dump/Topology29.json.result
0 → 100644
View file @
4e6513f6
{
"elementList": [
{
"_class": "Dream.Exit",
"id": "E1",
"results": {
"throughput": 1,
"takt_time": 1.75,
"lifespan": 1.75
}
},
{
"_class": "Dream.Machine",
"id": "M1",
"results": {
"working_ratio": 14.285714285714286,
"blockage_ratio": 0.0,
"failure_ratio": 0.0,
"waiting_ratio": 85.71428571428571
}
},
{
"_class": "Dream.Machine",
"id": "M2",
"results": {
"working_ratio": 85.71428571428571,
"blockage_ratio": 0.0,
"failure_ratio": 0.0,
"waiting_ratio": 14.285714285714286
}
}
],
"_class": "Dream.Simulation",
"general": {
"_class": "Dream.Configuration"
}
}
\ No newline at end of file
dream/tests/dump/Topology30.json.result
0 → 100644
View file @
4e6513f6
{
"elementList": [
{
"_class": "Dream.Exit",
"id": "E1",
"results": {
"throughput": 3,
"takt_time": 1.5,
"lifespan": 3.0
}
},
{
"_class": "Dream.Machine",
"id": "M1",
"results": {
"working_ratio": 11.11111111111111,
"blockage_ratio": 22.22222222222222,
"failure_ratio": 0.0,
"waiting_ratio": 66.66666666666667
}
},
{
"_class": "Dream.Machine",
"id": "M2",
"results": {
"working_ratio": 100.0,
"blockage_ratio": 0.0,
"failure_ratio": 0.0,
"waiting_ratio": 0.0
}
}
],
"_class": "Dream.Simulation",
"general": {
"_class": "Dream.Configuration"
}
}
\ No newline at end of file
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