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
8c717846
Commit
8c717846
authored
Jun 09, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now orders are entities that not run through the system but instead OrderDesigns.
parent
ab4276bc
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
94 additions
and
20 deletions
+94
-20
dream/simulation/Globals.py
dream/simulation/Globals.py
+3
-1
dream/simulation/Job.py
dream/simulation/Job.py
+2
-1
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+18
-6
dream/simulation/OrderDecomposition.py
dream/simulation/OrderDecomposition.py
+8
-8
dream/simulation/OrderDesign.py
dream/simulation/OrderDesign.py
+58
-0
dream/simulation/readWip.py
dream/simulation/readWip.py
+5
-4
No files found.
dream/simulation/Globals.py
View file @
8c717846
...
...
@@ -197,7 +197,8 @@ def setWIP(entityList):
# if the entity is of type Job/OrderComponent/Order/Mould
elif
entity
.
type
==
'Job'
or
entity
.
type
==
'OrderComponent'
or
entity
.
type
==
'Order'
or
entity
.
type
==
'Mould'
:
# XXX Orders do no more run in the system, instead we have OrderDesigns
elif
entity
.
type
==
'Job'
or
entity
.
type
==
'OrderComponent'
or
entity
.
type
==
'Order'
or
entity
.
type
==
'OrderDesign'
or
entity
.
type
==
'Mould'
:
# find the list of starting station of the entity
currentObjectIds
=
entity
.
remainingRoute
[
0
].
get
(
'stationIdsList'
,[])
# if the list of starting stations has length greater than one then there is a starting WIP definition error
...
...
@@ -231,6 +232,7 @@ def setWIP(entityList):
# if the currentStation of the entity is of type Machine then the entity
# must be processed first and then added to the pendingEntities list
# Its hot flag is not raised
# XXX hot variable not used any more
if
not
(
entity
.
currentStation
in
G
.
MachineList
):
# variable to inform whether the successors are machines or not
successorsAreMachines
=
True
...
...
dream/simulation/Job.py
View file @
8c717846
...
...
@@ -69,7 +69,8 @@ class Job(Entity): # inherits from the Entity c
completionTime
=
self
.
schedule
[
-
1
][
1
]
# TODO
# if the entity is of type Mould and the last object holding it is orderDecomposition
elif
self
.
type
==
'Order'
and
self
.
schedule
[
-
1
][
0
].
type
==
'OrderDecomposition'
:
#
# XXX now Orders do not run through the system but OrderDesigns do
elif
self
.
type
==
'OrderDesign'
and
self
.
schedule
[
-
1
][
0
].
type
==
'OrderDecomposition'
:
#
json
[
'results'
][
'completionTime'
]
=
self
.
schedule
[
-
1
][
1
]
completionTime
=
self
.
schedule
[
-
1
][
1
]
# TODO : check if there is a need for setting a different 'type' for the MouldAssembly than 'Machine'
...
...
dream/simulation/LineGenerationJSON.py
View file @
8c717846
...
...
@@ -78,6 +78,7 @@ from OrderComponent import OrderComponent
from
ScheduledMaintenance
import
ScheduledMaintenance
from
Failure
import
Failure
from
Order
import
Order
from
OrderDesign
import
OrderDesign
from
Mould
import
Mould
from
OrderDecomposition
import
OrderDecomposition
from
ConditionalBuffer
import
ConditionalBuffer
...
...
@@ -904,10 +905,12 @@ def createWIP():
G
.
EntityList
=
[]
G
.
PartList
=
[]
G
.
OrderComponentList
=
[]
G
.
DesignList
=
[]
# list of the OrderDesigns in the system
G
.
OrderList
=
[]
G
.
MouldList
=
[]
G
.
BatchList
=
[]
G
.
SubBatchList
=
[]
# entities that just finished processing in a station
# and have to enter the next machine
G
.
pendingEntities
=
[]
...
...
@@ -1174,14 +1177,23 @@ def createWIP():
'processingTime'
:
\
{
'distributionType'
:
'Fixed'
,
\
'mean'
:
'0'
}})
# initiate the Order
O
=
Order
(
id
,
name
,
route
,
priority
=
priority
,
dueDate
=
dueDate
,
orderDate
=
orderDate
,
# XXX durty way to implement new approach were the order is abstract and does not run through the system
# but the OrderDesign does
# XXX initiate the Order and the OrderDesign
O
=
Order
(
'G'
+
id
,
'general '
+
name
,
route
=
[],
priority
=
priority
,
dueDate
=
dueDate
,
orderDate
=
orderDate
,
isCritical
=
isCritical
,
basicsEnded
=
basicsEnded
,
manager
=
manager
,
componentsList
=
componentsList
,
componentsReadyForAssembly
=
componentsReadyForAssembly
,
extraPropertyDict
=
extraPropertyDict
)
G
.
OrderList
.
append
(
O
)
G
.
WipList
.
append
(
O
)
G
.
EntityList
.
append
(
O
)
G
.
JobList
.
append
(
O
)
# create the OrderDesign
OD
=
OrderDesign
(
id
,
name
,
route
,
priority
=
priority
,
dueDate
=
dueDate
,
orderDate
=
orderDate
,
isCritical
=
isCritical
,
order
=
O
,
extraPropertyDict
=
extraPropertyDict
)
# add the order to the OrderList
G
.
OrderList
.
append
(
O
)
# add the OrderDesign to the DesignList and the OrderComponentList
G
.
OrderComponentList
.
append
(
OD
)
G
.
DesignList
.
append
(
OD
)
G
.
WipList
.
append
(
OD
)
G
.
EntityList
.
append
(
OD
)
G
.
JobList
.
append
(
OD
)
# ===========================================================================
# reads the interruptions of the stations
...
...
dream/simulation/OrderDecomposition.py
View file @
8c717846
...
...
@@ -36,6 +36,7 @@ from RandomNumberGenerator import RandomNumberGenerator
from
Entity
import
Entity
from
Order
import
Order
from
OrderDesign
import
OrderDesign
from
OrderComponent
import
OrderComponent
# ===========================================================================
...
...
@@ -178,23 +179,24 @@ class OrderDecomposition(CoreObject):
def
decompose
(
self
):
activeObjectQueue
=
self
.
getActiveObjectQueue
()
#loop in the internal Queue. Decompose only if an Entity is of type order
# XXX now instead of Order we have OrderDesign
for
entity
in
activeObjectQueue
:
if
entity
.
type
==
'Order'
:
self
.
orderToBeDecomposed
=
entity
if
entity
.
type
==
'Order
Design
'
:
self
.
orderToBeDecomposed
=
entity
.
order
activeObjectQueue
.
remove
(
entity
)
#remove the order from the internal Queue
# if the entity is in G.pendingEntities list remove it from there
if
entity
in
G
.
pendingEntities
:
G
.
pendingEntities
.
remove
(
entity
)
#append the components in the internal queue
for
component
in
entity
.
componentsList
:
for
component
in
entity
.
order
.
componentsList
:
self
.
createOrderComponent
(
component
)
# after the creation of the order's components update each components auxiliary list
# if there are auxiliary components
if
len
(
entity
.
auxiliaryComponentsList
):
if
len
(
entity
.
order
.
auxiliaryComponentsList
):
# for every auxiliary component
for
auxComponent
in
entity
.
auxiliaryComponentsList
:
for
auxComponent
in
entity
.
order
.
auxiliaryComponentsList
:
# run through the componentsList of the order
for
reqComponent
in
entity
.
componentsList
:
for
reqComponent
in
entity
.
order
.
componentsList
:
# to find the requestingComponent of the auxiliary component
if
auxComponent
.
requestingComponent
==
reqComponent
.
id
:
# and add the auxiliary to the requestingComponent auxiliaryList
...
...
@@ -241,7 +243,6 @@ class OrderDecomposition(CoreObject):
#have to talk about it with NEX
exitAssigned
=
False
for
element
in
route
:
# elementId=element[0]
elementIds
=
element
.
get
(
'stationIdsList'
,[])
for
obj
in
G
.
ObjList
:
for
elementId
in
elementIds
:
...
...
@@ -267,7 +268,6 @@ class OrderDecomposition(CoreObject):
exitId
=
obj
.
id
break
if
exitId
:
# route.append([exitId, 0])
route
.
append
({
'stationIdsList'
:[
str
(
exitId
)],
\
'processingTime'
:{}})
...
...
dream/simulation/OrderDesign.py
0 → 100644
View file @
8c717846
# ===========================================================================
# Copyright 2013 University of Limerick
#
# This file is part of DREAM.
#
# DREAM is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# DREAM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with DREAM. If not, see <http://www.gnu.org/licenses/>.
# ===========================================================================
'''
Created on 06 Jun 2014
@author: Ioannis
'''
'''
OrderDesign is an Entity that is a component of a broader order,
and is processed before it gets broken down into other components
'''
from
Globals
import
G
from
Job
import
Job
# ===========================================================================
# The OrderComponent object
# ===========================================================================
class
OrderDesign
(
Job
):
# inherits from the Job class
type
=
"OrderDesign"
def
__init__
(
self
,
id
=
None
,
name
=
None
,
route
=
[],
priority
=
0
,
dueDate
=
None
,
orderDate
=
None
,
extraPropertyDict
=
None
,
order
=
None
,
requestingComponent
=
None
,
isCritical
=
False
):
Job
.
__init__
(
self
,
id
,
name
,
route
,
priority
,
dueDate
,
orderDate
,
extraPropertyDict
,
isCritical
)
self
.
order
=
order
# parent order of the order component
# TODO: in case the order is not given as argument (when the component is given as WIP) have to give a manager as argument
# or create the initiate the parent order not as WIP
if
self
.
order
:
# if the order is not None, and the order.manager is given
if
self
.
order
.
manager
:
self
.
manager
=
self
.
order
.
manager
# if the componentType of the component is Auxiliary then there need a requesting Component be defined
# the requestingComponent is the component that needs the auxiliary component during its processing
# the auxiliary component should then be added to the requestingComponent's auxiliaryList
self
.
requestingComponent
=
requestingComponent
# the id of the requesting component
\ No newline at end of file
dream/simulation/readWip.py
View file @
8c717846
...
...
@@ -35,6 +35,7 @@ from OrderComponent import OrderComponent
from
ScheduledMaintenance
import
ScheduledMaintenance
from
Failure
import
Failure
from
Order
import
Order
from
OrderDesign
import
OrderDesign
from
Mould
import
Mould
from
OrderDecomposition
import
OrderDecomposition
from
ConditionalBuffer
import
ConditionalBuffer
...
...
@@ -405,7 +406,7 @@ def getComponets(orderDict,Order):
# initiate the job
OC
=
OrderComponent
(
id
,
name
,
route_list
,
priority
=
Order
.
priority
,
dueDate
=
Order
.
dueDate
,
orderDate
=
Order
.
orderDate
,
componentType
=
componentType
,
order
=
Order
,
readyForAssembly
=
readyForAssembly
,
extraPropertyDict
=
extraPropertyDict
)
isCritical
=
Order
.
isCritical
,
extraPropertyDict
=
extraPropertyDict
)
G
.
OrderComponentList
.
append
(
OC
)
G
.
JobList
.
append
(
OC
)
G
.
WipList
.
append
(
OC
)
...
...
@@ -427,7 +428,7 @@ def getComponets(orderDict,Order):
if
id
in
G
.
WipIDList
:
# initiate the job
M
=
Mould
(
id
,
name
,
route_list
,
priority
=
Order
.
priority
,
dueDate
=
Order
.
dueDate
,
orderDate
=
Order
.
orderDate
,
extraPropertyDict
=
extraPropertyDict
,
order
=
Order
)
isCritical
=
Order
.
isCritical
,
extraPropertyDict
=
extraPropertyDict
,
order
=
Order
)
G
.
MouldList
.
append
(
M
)
G
.
JobList
.
append
(
M
)
G
.
WipList
.
append
(
M
)
...
...
@@ -447,8 +448,8 @@ def getComponets(orderDict,Order):
if
(
id
in
G
.
WipIDList
)
or
\
(
not
id
in
G
.
WipIDList
and
len
(
Order
.
auxiliaryComponentsList
+
Order
.
secondaryComponentsList
+
Order
.
basicComponentsList
)
==
0
):
# initiate the job
OD
=
Design
(
id
,
name
,
route_list
,
priority
=
Order
.
priority
,
dueDate
=
Order
.
dueDate
,
orderDate
=
Order
.
orderDate
,
order
=
Order
,
extraPropertyDict
=
extraPropertyDict
)
OD
=
Order
Design
(
id
,
name
,
route_list
,
priority
=
Order
.
priority
,
dueDate
=
Order
.
dueDate
,
orderDate
=
Order
.
orderDate
,
isCritical
=
Order
.
isCritical
,
order
=
Order
,
extraPropertyDict
=
extraPropertyDict
)
G
.
OrderComponentList
.
append
(
OD
)
G
.
DesignList
.
append
(
OD
)
G
.
JobList
.
append
(
OD
)
...
...
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