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
3b91572e
Commit
3b91572e
authored
Feb 02, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'CapacityStationPlugins' into renderjsie_merged
parents
a25184c1
621ee478
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
953 additions
and
71 deletions
+953
-71
dream/plugins/AvailableCapacitySpreadsheet.py
dream/plugins/AvailableCapacitySpreadsheet.py
+47
-0
dream/plugins/CapacityProjectSpreadsheet.py
dream/plugins/CapacityProjectSpreadsheet.py
+65
-0
dream/plugins/plugin.py
dream/plugins/plugin.py
+2
-2
dream/simulation/Examples/BatchAllInOneEmpty.json
dream/simulation/Examples/BatchAllInOneEmpty.json
+30
-23
dream/simulation/Examples/CapacityProjectAllInOneEmpty.json
dream/simulation/Examples/CapacityProjectAllInOneEmpty.json
+733
-0
dream/simulation/Examples/DefaultAllInOneEmpty2.json
dream/simulation/Examples/DefaultAllInOneEmpty2.json
+44
-28
dream/simulation/Examples/JobShopAllInOneEmpty.json
dream/simulation/Examples/JobShopAllInOneEmpty.json
+14
-7
dream/simulation/Examples/PartJobShopAllInOneEmpty.json
dream/simulation/Examples/PartJobShopAllInOneEmpty.json
+18
-11
No files found.
dream/plugins/AvailableCapacitySpreadsheet.py
0 → 100644
View file @
3b91572e
from
copy
import
copy
import
json
import
time
import
random
import
operator
import
datetime
from
dream.plugins
import
plugin
class
AvailableCapacitySpreadsheet
(
plugin
.
InputPreparationPlugin
):
""" Input prepration
read capacity data and update the capacity property of the stations.
"""
def
preprocess
(
self
,
data
):
strptime
=
datetime
.
datetime
.
strptime
capacityData
=
data
[
'input'
].
get
(
'available_capacity_spreadsheet'
,
None
)
node
=
data
[
'graph'
][
'node'
]
now
=
strptime
(
data
[
'general'
][
'currentDate'
],
'%Y/%m/%d'
)
if
capacityData
:
numberOfStations
=
len
(
capacityData
[
0
])
-
1
numberOfExceptions
=
len
(
capacityData
)
# loop through stations
for
col
in
range
(
numberOfStations
):
stationId
=
capacityData
[
0
][
col
+
1
]
assert
stationId
in
data
[
'graph'
][
'node'
].
keys
(),
'available capacity spreadsheet has station id that does not exist in production line'
# for every station read the interval capacity (Monday to Sunday)
intervalCapacity
=
[]
for
row
in
range
(
7
):
intervalCapacity
.
append
(
float
(
capacityData
[
row
+
1
][
col
+
1
]))
node
[
stationId
][
'intervalCapacity'
]
=
intervalCapacity
# for every station read the interval capacity exceptions
for
row
in
range
(
8
,
len
(
capacityData
)):
if
not
capacityData
[
row
][
0
]:
break
exeptionDate
=
strptime
(
capacityData
[
row
][
0
],
'%Y/%m/%d'
)
dayDifference
=
(
exeptionDate
-
now
).
days
assert
dayDifference
>=
0
,
'exception date for past day given'
intervalCapacityExceptions
=
node
[
stationId
].
get
(
'intervalCapacityExceptions'
,{})
if
not
intervalCapacityExceptions
:
node
[
stationId
][
'intervalCapacityExceptions'
]
=
{}
node
[
stationId
][
'intervalCapacityExceptions'
][
str
(
float
(
dayDifference
))]
=
float
(
capacityData
[
row
][
col
+
1
])
# set the interval capacity start
node
[
stationId
][
'intervalCapacityStart'
]
=
now
.
weekday
()
return
data
\ No newline at end of file
dream/plugins/CapacityProjectSpreadsheet.py
0 → 100644
View file @
3b91572e
from
copy
import
copy
import
json
import
time
import
random
import
operator
import
datetime
from
dream.plugins
import
plugin
class
CapacityProjectSpreadsheet
(
plugin
.
InputPreparationPlugin
):
""" Input prepration
read the capacity projects from the spreadsheet
"""
def
preprocess
(
self
,
data
):
strptime
=
datetime
.
datetime
.
strptime
projectData
=
data
[
'input'
].
get
(
'projects_spreadsheet'
,
None
)
data
[
'input'
][
'BOM'
]
=
{}
# Put the projects in BOM. Discuss this!
node
=
data
[
'graph'
][
'node'
]
now
=
strptime
(
data
[
'general'
][
'currentDate'
],
'%Y/%m/%d'
)
if
projectData
:
for
row
in
range
(
1
,
len
(
projectData
)):
if
projectData
[
row
][
0
]:
projectId
=
projectData
[
row
][
0
]
orderDate
=
strptime
(
projectData
[
row
][
1
],
'%Y/%m/%d'
)
orderDate
=
(
orderDate
-
now
).
days
try
:
dueDate
=
strptime
(
projectData
[
row
][
2
],
'%Y/%m/%d'
)
dueDate
=
(
dueDate
-
now
).
days
# if no due date is given set it to 180 (about 6 months)
except
ValueError
:
dueDate
=
180
assemblySpaceRequirement
=
float
(
projectData
[
row
][
3
])
capacityRequirementDict
=
{}
earliestStartDict
=
{}
# get the number of operations of the project
numberOfOperations
=
1
i
=
1
while
not
projectData
[
row
+
i
][
0
]:
# if a completely empty line is found break
if
all
(
v
is
None
for
v
in
projectData
[
row
+
i
]):
break
numberOfOperations
+=
1
i
+=
1
# for every operation get capacityRequirementDict and earliestStartDict
for
stationRecord
in
range
(
numberOfOperations
):
stationId
=
projectData
[
row
+
stationRecord
][
4
]
requiredCapacity
=
projectData
[
row
+
stationRecord
][
5
]
earliestStart
=
projectData
[
row
+
stationRecord
][
6
]
capacityRequirementDict
[
stationId
]
=
float
(
requiredCapacity
)
if
earliestStart
:
earliestStart
=
strptime
(
earliestStart
,
'%Y/%m/%d'
)
earliestStartDict
[
stationId
]
=
(
earliestStart
-
now
).
days
# define the order in BOM
data
[
'input'
][
'BOM'
][
projectId
]
=
{
'orderDate'
:
orderDate
,
'dueDate'
:
dueDate
,
'assemblySpaceRequirement'
:
assemblySpaceRequirement
,
'capacityRequirementDict'
:
capacityRequirementDict
,
'earliestStartDict'
:
earliestStartDict
}
print
data
[
'input'
][
'BOM'
]
return
data
\ No newline at end of file
dream/plugins/plugin.py
View file @
3b91572e
...
...
@@ -54,11 +54,11 @@ class PluginRegistry(object):
def
__init__
(
self
,
logger
,
data
):
self
.
input_preparation_list
=
[]
for
plugin_data
in
data
[
'application_configuration'
][
'pre_processing
_
plugin_list'
]:
for
plugin_data
in
data
[
'application_configuration'
][
'pre_processing
'
][
'
plugin_list'
]:
self
.
input_preparation_list
.
append
(
resolve
(
plugin_data
[
'_class'
])(
logger
,
plugin_data
))
self
.
output_preparation_list
=
[]
for
plugin_data
in
data
[
'application_configuration'
][
'post_processing
_
plugin_list'
]:
for
plugin_data
in
data
[
'application_configuration'
][
'post_processing
'
][
'
plugin_list'
]:
self
.
output_preparation_list
.
append
(
resolve
(
plugin_data
[
'_class'
])(
logger
,
plugin_data
))
plugin_data
=
data
[
'application_configuration'
][
'processing_plugin'
]
...
...
dream/simulation/Examples/BatchAllInOneEmpty.json
View file @
3b91572e
...
...
@@ -261,30 +261,37 @@
"type"
:
"object_view"
}
},
"post_processing_plugin_list"
:
[],
"pre_processing_plugin_list"
:
[
{
"_class"
:
"dream.plugins.GatherWIPStat.GatherWIPStat"
,
"input_id"
:
"WIPStat"
},
{
"_class"
:
"dream.plugins.ReadEntryData.ReadEntryData"
,
"input_id"
:
"EntryData"
},
{
"_class"
:
"dream.plugins.BatchesWIPSpreadsheet.BatchesWIPSpreadsheet"
,
"input_id"
:
"WipSpreadsheet"
},
{
"_class"
:
"dream.plugins.ReadSkilledOperators.ReadSkilledOperators"
,
"input_id"
:
"SkilledOperatorsSpreadsheet"
},
{
"_class"
:
"dream.plugins.ReadShiftFromSpreadsheet.ReadShiftFromSpreadsheet"
,
"input_id"
:
"ShiftSpreadsheet"
}
],
"post_processing"
:
{
"description"
:
""
,
"plugin_list"
:
[]
},
"pre_processing"
:
{
"description"
:
""
,
"plugin_list"
:
[
{
"_class"
:
"dream.plugins.GatherWIPStat.GatherWIPStat"
,
"input_id"
:
"WIPStat"
},
{
"_class"
:
"dream.plugins.ReadEntryData.ReadEntryData"
,
"input_id"
:
"EntryData"
},
{
"_class"
:
"dream.plugins.BatchesWIPSpreadsheet.BatchesWIPSpreadsheet"
,
"input_id"
:
"WipSpreadsheet"
},
{
"_class"
:
"dream.plugins.ReadSkilledOperators.ReadSkilledOperators"
,
"input_id"
:
"SkilledOperatorsSpreadsheet"
},
{
"_class"
:
"dream.plugins.ReadShiftFromSpreadsheet.ReadShiftFromSpreadsheet"
,
"input_id"
:
"ShiftSpreadsheet"
}
]
},
"processing_plugin"
:
{
"description"
:
""
,
"_class"
:
"dream.plugins.plugin.DefaultExecutionPlugin"
}
},
...
...
dream/simulation/Examples/CapacityProjectAllInOneEmpty.json
0 → 100644
View file @
3b91572e
This diff is collapsed.
Click to expand it.
dream/simulation/Examples/DefaultAllInOneEmpty2.json
View file @
3b91572e
...
...
@@ -314,24 +314,13 @@
]
},
"_operationType"
:
{
"_class"
:
"Dream.PropertyList"
,
"name"
:
"Operation type"
,
"id"
:
"operationType"
,
"description"
:
"the type of operations that are performed manually in the machine"
,
"properties"
:
{
"operationType"
:
{
"type"
:
"string"
,
"enum"
:
[
"Load"
,
"Setup"
,
"Processing"
,
"MT-Load"
,
"MT-Load-Setup"
,
"MT-Load-Setup-Processing"
,
"MT-Setup-Processing"
]
}
}
"default"
:
"Automatic"
,
"type"
:
"string"
,
"enum"
:
[
"Automatic"
,
"Manual"
]
}
},
"edge"
:
{
...
...
@@ -479,6 +468,34 @@
"default"
:
"M"
,
"required"
:
true
},
"operationType"
:
{
"description"
:
"Type Of Operation"
,
"name"
:
"Operation Type"
,
"type"
:
"object"
,
"properties"
:
{
"load"
:
{
"description"
:
"Operation type for loading"
,
"$ref"
:
"#/definitions/_operationType"
},
"setup"
:
{
"description"
:
"Operation type for setup"
,
"$ref"
:
"#/definitions/_operationType"
,
},
"processing"
:
{
"description"
:
"Operation type for processing"
,
"$ref"
:
"#/definitions/_operationType"
,
}
}
"required"
:
[
"load"
,
"setup"
,
"processing"
]
},
"loadTime"
:
{
"$ref"
:
"#/definitions/_dist"
,
"required"
:
true
},
"setupTime"
:
{
"$ref"
:
"#/definitions/_dist"
,
"required"
:
true
},
"processingTime"
:
{
"$ref"
:
"#/definitions/_dist"
,
"required"
:
true
...
...
@@ -772,27 +789,26 @@
}
}
},
"preprocessing"
:
{
"pre_processing"
:
{
"description"
:
""
,
"plugin_list"
:
[
{
"
plugin"
:
"
GatherWIPStat.GatherWIPStat"
,
"
_class"
:
"dream.plugins.
GatherWIPStat.GatherWIPStat"
,
"input_id"
:
"WIPStat"
},
{
"
plugin"
:
"
WIPSpreadsheet.WIPSpreadsheet"
,
"
_class"
:
"dream.plugins.
WIPSpreadsheet.WIPSpreadsheet"
,
"input_id"
:
"WIPdata"
}
]
},
"processing"
:
{
"plugin_list"
:
[
{
"plugin"
:
"plugin.DefaultExecutionPlugin"
,
"input_id"
:
"Simulation"
}
]
"processing_plugin"
:
{
"description"
:
""
,
"_class"
:
"dream.plugins.plugin.DefaultExecutionPlugin"
,
"input_id"
:
"Simulation"
},
"postprocessing"
:
{
"post_processing"
:
{
"description"
:
""
,
"plugin_list"
:
[]
},
"general"
:
{
...
...
dream/simulation/Examples/JobShopAllInOneEmpty.json
View file @
3b91572e
...
...
@@ -838,25 +838,32 @@
}
}
},
"preprocessing"
:
{
"pre_processing"
:
{
"description"
:
""
,
"plugin_list"
:
[{
"
plugin"
:
"
PartJobShop"
,
"
_class"
:
"dream.plugins.PartJobShop.
PartJobShop"
,
"input_id"
:
"Simulation"
},
{
"
plugin"
:
"
ReadShiftFromSpreadsheet"
,
"
_class"
:
"dream.plugins.ReadShiftFromSpreadsheet.
ReadShiftFromSpreadsheet"
,
"input_id"
:
"ShiftSpreadsheet"
},
{
"
plugin"
:
"
ReadWipFromSpreadsheet"
,
"
_class"
:
"dream.plugins.ReadWipFromSpreadsheet.
ReadWipFromSpreadsheet"
,
"input_id"
:
"WipSpreadsheet"
},
{
"
plugin"
:
"
ReadRouteFromSpreadsheet"
,
"
_class"
:
"dream.plugins.ReadRouteFromSpreadsheet.
ReadRouteFromSpreadsheet"
,
"input_id"
:
"RouteSpreadsheet"
}
]
},
"postprocessing"
:
{
"processing_plugin"
:
{
"description"
:
""
,
"_class"
:
""
,
"input_id"
:
""
}
"post_processing"
:
{
"description"
:
""
,
"plugin_list"
:
[{
"
plugin"
:
"
CalculateConfidenceIntervals"
"
_class"
:
"dream.plugins.CalculateConfidenceIntervals.
CalculateConfidenceIntervals"
}]
},
"general"
:
{
...
...
dream/simulation/Examples/PartJobShopAllInOneEmpty.json
View file @
3b91572e
...
...
@@ -810,20 +810,27 @@
}
}
},
"pre_processing_plugin_list"
:
[
{
"_class"
:
"dream.plugins.Debug.Debug"
,
"argument"
:
"Argument Value"
},
{
"_class"
:
"dream.plugins.OldStylePartJobShopWIP.OldStylePartJobShopWIP"
,
"input_id"
:
"old_style_part_jobshop_spreadsheet"
}
],
"pre_processing"
:
{
"description"
:
""
,
"_plugin_list"
:
[
{
"_class"
:
"dream.plugins.Debug.Debug"
,
"argument"
:
"Argument Value"
},
{
"_class"
:
"dream.plugins.OldStylePartJobShopWIP.OldStylePartJobShopWIP"
,
"input_id"
:
"old_style_part_jobshop_spreadsheet"
}
]
},
"processing_plugin"
:
{
"description"
:
""
,
"_class"
:
"dream.plugins.ACO.ACO"
},
"post_processing_plugin_list"
:
[],
"post_processing"
:
{
"description"
:
""
,
"plugin_list"
:
[]
},
"general"
:
{
"properties"
:
{
"numberOfReplications"
:
{
...
...
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