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
a5868f3a
Commit
a5868f3a
authored
Nov 27, 2013
by
Georgios Dagkakis
Committed by
Jérome Perrin
Dec 02, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
main script updated to read the wip as CoreObject attribute
parent
cedfdae2
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
334 additions
and
297 deletions
+334
-297
dream/simulation/JSONInputs/Topology18.json
dream/simulation/JSONInputs/Topology18.json
+42
-39
dream/simulation/JSONInputs/Topology19.json
dream/simulation/JSONInputs/Topology19.json
+84
-78
dream/simulation/JSONInputs/Topology20.json
dream/simulation/JSONInputs/Topology20.json
+153
-145
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+55
-35
No files found.
dream/simulation/JSONInputs/Topology18.json
View file @
a5868f3a
...
...
@@ -68,7 +68,48 @@
"_class"
:
"Dream.QueueJobShop"
,
"name"
:
"Queue1"
,
"isDummy"
:
"0"
,
"capacity"
:
"1000"
"capacity"
:
"1000"
,
"wip"
:
[
{
"_class"
:
"Dream.Job"
,
"name"
:
"Job1"
,
"id"
:
"J1"
,
"route"
:
[
{
"stepNumber"
:
"0"
,
"stationId"
:
"Q1"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"1"
}
},
{
"stepNumber"
:
"1"
,
"stationId"
:
"Q3"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"3"
}
},
{
"stepNumber"
:
"2"
,
"stationId"
:
"Q2"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"2"
}
},
{
"stepNumber"
:
"3"
,
"stationId"
:
"E1"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"0"
}
}
]
}
]
},
"Q2"
:
{
"_class"
:
"Dream.QueueJobShop"
,
...
...
@@ -86,44 +127,6 @@
"E1"
:
{
"_class"
:
"Dream.ExitJobShop"
,
"name"
:
"Exit"
},
"J1"
:
{
"_class"
:
"Dream.Job"
,
"name"
:
"Job1"
,
"route"
:
[
{
"stepNumber"
:
"0"
,
"stationId"
:
"Q1"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"1"
}
},
{
"stepNumber"
:
"1"
,
"stationId"
:
"Q3"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"3"
}
},
{
"stepNumber"
:
"2"
,
"stationId"
:
"Q2"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"2"
}
},
{
"stepNumber"
:
"3"
,
"stationId"
:
"E1"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"0"
}
}
]
}
}
}
\ No newline at end of file
dream/simulation/JSONInputs/Topology19.json
View file @
a5868f3a
...
...
@@ -68,14 +68,96 @@
"_class"
:
"Dream.QueueJobShop"
,
"name"
:
"Queue1"
,
"isDummy"
:
"0"
,
"capacity"
:
"1000"
"capacity"
:
"1000"
,
"wip"
:
[
{
"id"
:
"J1"
,
"_class"
:
"Dream.Job"
,
"name"
:
"Job1"
,
"route"
:
[
{
"stepNumber"
:
"0"
,
"stationId"
:
"Q1"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"1"
}
},
{
"stepNumber"
:
"1"
,
"stationId"
:
"Q3"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"3"
}
},
{
"stepNumber"
:
"2"
,
"stationId"
:
"Q2"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"2"
}
},
{
"stepNumber"
:
"3"
,
"stationId"
:
"E1"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"0"
}
}
]
}
]
},
"Q2"
:
{
"_class"
:
"Dream.QueueJobShop"
,
"id"
:
"Q2"
,
"name"
:
"Queue2"
,
"isDummy"
:
"0"
,
"capacity"
:
"1000"
"capacity"
:
"1000"
,
"wip"
:
[
{
"id"
:
"J2"
,
"_class"
:
"Dream.Job"
,
"name"
:
"Job2"
,
"route"
:
[
{
"stepNumber"
:
"0"
,
"stationId"
:
"Q2"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"3"
}
},
{
"stepNumber"
:
"1"
,
"stationId"
:
"Q3"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"1"
}
},
{
"stepNumber"
:
"2"
,
"stationId"
:
"Q2"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"7"
}
},
{
"stepNumber"
:
"3"
,
"stationId"
:
"E1"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"0"
}
}
]
}
]
},
"Q3"
:
{
"_class"
:
"Dream.QueueJobShop"
,
...
...
@@ -86,82 +168,6 @@
"E1"
:
{
"_class"
:
"Dream.ExitJobShop"
,
"name"
:
"Exit"
},
"J1"
:
{
"_class"
:
"Dream.Job"
,
"name"
:
"Job1"
,
"route"
:
[
{
"stepNumber"
:
"0"
,
"stationId"
:
"Q1"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"1"
}
},
{
"stepNumber"
:
"1"
,
"stationId"
:
"Q3"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"3"
}
},
{
"stepNumber"
:
"2"
,
"stationId"
:
"Q2"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"2"
}
},
{
"stepNumber"
:
"3"
,
"stationId"
:
"E1"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"0"
}
}
]
},
"J2"
:
{
"_class"
:
"Dream.Job"
,
"name"
:
"Job2"
,
"route"
:
[
{
"stepNumber"
:
"0"
,
"stationId"
:
"Q2"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"3"
}
},
{
"stepNumber"
:
"1"
,
"stationId"
:
"Q3"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"1"
}
},
{
"stepNumber"
:
"2"
,
"stationId"
:
"Q2"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"7"
}
},
{
"stepNumber"
:
"3"
,
"stationId"
:
"E1"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"0"
}
}
]
}
}
}
\ No newline at end of file
dream/simulation/JSONInputs/Topology20.json
View file @
a5868f3a
This diff is collapsed.
Click to expand it.
dream/simulation/LineGenerationJSON.py
View file @
a5868f3a
...
...
@@ -132,9 +132,6 @@ def createObjects():
G
.
AssemblyList
=
[]
G
.
DismantleList
=
[]
G
.
ConveyerList
=
[]
G
.
JobList
=
[]
G
.
WipList
=
[]
G
.
EntityList
=
[]
G
.
MachineJobShopList
=
[]
G
.
QueueJobShopList
=
[]
G
.
ExitJobShopList
=
[]
...
...
@@ -374,34 +371,7 @@ def createObjects():
C
.
nextIds
=
getSuccessorList
(
id
)
G
.
ObjList
.
append
(
C
)
G
.
ConveyerList
.
append
(
C
)
elif
objClass
==
'Dream.Job'
:
id
=
element
.
get
(
'id'
,
'not found'
)
name
=
element
.
get
(
'name'
,
'not found'
)
priority
=
int
(
element
.
get
(
'priority'
,
'0'
))
dueDate
=
float
(
element
.
get
(
'dueDate'
,
'0'
))
orderDate
=
float
(
element
.
get
(
'orderDate'
,
'0'
))
JSONRoute
=
element
.
get
(
'route'
,
[])
# dummy variable that holds the routes of the jobs
# the route from the JSON file
# is a sequence of dictionaries
route
=
[
None
for
i
in
range
(
len
(
JSONRoute
))]
# variable that holds the argument used in the Job initiation
# hold None for each entry in the 'route' list
for
routeElement
in
JSONRoute
:
# for each 'step' dictionary in the JSONRoute
stepNumber
=
int
(
routeElement
.
get
(
'stepNumber'
,
'0'
))
# get the stepNumber
nextId
=
routeElement
.
get
(
'stationId'
,
'not found'
)
# the stationId
processingTime
=
routeElement
.
get
(
'processingTime'
,
'not found'
)
# and the 'processingTime' dictionary
distributionType
=
processingTime
.
get
(
'distributionType'
,
'not found'
)
# and from that dictionary
# get the 'mean'
mean
=
float
(
processingTime
.
get
(
'mean'
,
'not found'
))
route
[
stepNumber
]
=
[
nextId
,
mean
]
# finally add the 'nextId' and 'mean'
# to the job route
# initiate the job
J
=
Job
(
id
,
name
,
route
,
priority
=
priority
,
dueDate
=
dueDate
,
orderDate
=
orderDate
)
G
.
JobList
.
append
(
J
)
G
.
WipList
.
append
(
J
)
G
.
EntityList
.
append
(
J
)
elif
objClass
==
'Dream.BatchDecomposition'
:
id
=
element
.
get
(
'id'
,
'not found'
)
name
=
element
.
get
(
'name'
,
'not found'
)
...
...
@@ -525,6 +495,56 @@ def activateObjects():
except
AttributeError
:
pass
# ===========================================================================
# reads the WIP of the stations
# ===========================================================================
def
createWIP
():
G
.
JobList
=
[]
G
.
WipList
=
[]
G
.
EntityList
=
[]
json_data
=
G
.
JSONData
#Read the json data
nodes
=
json_data
[
'nodes'
]
# read from the dictionary the dicts with key 'nodes'
for
(
element_id
,
element
)
in
nodes
.
iteritems
():
element
[
'id'
]
=
element_id
wip
=
element
.
get
(
'wip'
,
[])
for
entity
in
wip
:
entityClass
=
None
try
:
entityClass
=
entity
.
get
(
'_class'
,
None
)
except
IndexError
:
continue
if
entityClass
==
'Dream.Job'
:
id
=
entity
.
get
(
'id'
,
'not found'
)
name
=
entity
.
get
(
'name'
,
'not found'
)
priority
=
int
(
entity
.
get
(
'priority'
,
'0'
))
dueDate
=
float
(
entity
.
get
(
'dueDate'
,
'0'
))
orderDate
=
float
(
entity
.
get
(
'orderDate'
,
'0'
))
JSONRoute
=
entity
.
get
(
'route'
,
[])
# dummy variable that holds the routes of the jobs
# the route from the JSON file
# is a sequence of dictionaries
route
=
[
None
for
i
in
range
(
len
(
JSONRoute
))]
# variable that holds the argument used in the Job initiation
# hold None for each entry in the 'route' list
for
routeentity
in
JSONRoute
:
# for each 'step' dictionary in the JSONRoute
stepNumber
=
int
(
routeentity
.
get
(
'stepNumber'
,
'0'
))
# get the stepNumber
nextId
=
routeentity
.
get
(
'stationId'
,
'not found'
)
# the stationId
processingTime
=
routeentity
.
get
(
'processingTime'
,
'not found'
)
# and the 'processingTime' dictionary
distributionType
=
processingTime
.
get
(
'distributionType'
,
'not found'
)
# and from that dictionary
# get the 'mean'
mean
=
float
(
processingTime
.
get
(
'mean'
,
'not found'
))
route
[
stepNumber
]
=
[
nextId
,
mean
]
# finally add the 'nextId' and 'mean'
# to the job route
# initiate the job
J
=
Job
(
id
,
name
,
route
,
priority
=
priority
,
dueDate
=
dueDate
,
orderDate
=
orderDate
)
G
.
JobList
.
append
(
J
)
G
.
WipList
.
append
(
J
)
G
.
EntityList
.
append
(
J
)
# ===========================================================================
# sets the WIP in the corresponding stations
# ===========================================================================
...
...
@@ -538,7 +558,7 @@ def setWIP():
object
=
obj
# find the object in the 'G.ObjList
object
.
getActiveObjectQueue
().
append
(
entity
)
# append the entity to its Queue
entity
.
remainingRoute
[
0
][
0
]
=
""
# remove data from the remaining route.
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
# ===========================================================================
...
...
@@ -568,15 +588,15 @@ def main(argv=[], input_data=None):
G
.
JSONData
=
json
.
loads
(
G
.
InputData
)
# create the dictionary JSONData
readGeneralInput
()
createObjects
()
createWIP
()
setTopology
()
#run the experiment (replications)
for
i
in
xrange
(
G
.
numberOfReplications
):
logger
.
info
(
"start run number "
+
str
(
i
+
1
))
G
.
seed
+=
1
G
.
Rnd
=
Random
(
G
.
seed
)
G
.
Rnd
=
Random
(
G
.
seed
)
initialize
()
#initialize the simulation
initializeObjects
()
setWIP
()
...
...
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