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
41f8415a
Commit
41f8415a
authored
Jan 21, 2014
by
Ioannis Papagiannopoulos
Committed by
Jérome Perrin
Feb 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OrderDecomposition modified to avoid creating entities of type Mould
parent
ec0a8e72
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
73 deletions
+99
-73
dream/simulation/Order.py
dream/simulation/Order.py
+12
-2
dream/simulation/OrderComponent.py
dream/simulation/OrderComponent.py
+11
-3
dream/simulation/OrderDecomposition.py
dream/simulation/OrderDecomposition.py
+76
-68
No files found.
dream/simulation/Order.py
View file @
41f8415a
...
@@ -34,8 +34,18 @@ from Job import Job
...
@@ -34,8 +34,18 @@ from Job import Job
class
Order
(
Job
):
class
Order
(
Job
):
type
=
"Order"
type
=
"Order"
def
__init__
(
self
,
id
=
None
,
name
=
None
,
route
=
[],
priority
=
0
,
dueDate
=
None
,
orderDate
=
None
,
isCritical
=
False
,
def
__init__
(
self
,
id
=
None
,
componentsList
=
[],
manager
=
None
,
basicsEnded
=
0
,
componentsReadyForAssembly
=
0
,
extraPropertyDict
=
None
):
name
=
None
,
route
=
[],
priority
=
0
,
dueDate
=
None
,
orderDate
=
None
,
isCritical
=
False
,
componentsList
=
[],
manager
=
None
,
basicsEnded
=
0
,
componentsReadyForAssembly
=
0
,
extraPropertyDict
=
None
):
Job
.
__init__
(
self
,
id
=
id
,
name
=
name
,
route
=
route
,
priority
=
priority
,
dueDate
=
dueDate
,
orderDate
=
orderDate
,
Job
.
__init__
(
self
,
id
=
id
,
name
=
name
,
route
=
route
,
priority
=
priority
,
dueDate
=
dueDate
,
orderDate
=
orderDate
,
extraPropertyDict
=
extraPropertyDict
)
extraPropertyDict
=
extraPropertyDict
)
self
.
isCritical
=
isCritical
# flag to inform weather the order is critical -> preemption
self
.
isCritical
=
isCritical
# flag to inform weather the order is critical -> preemption
...
...
dream/simulation/OrderComponent.py
View file @
41f8415a
...
@@ -34,9 +34,17 @@ from Job import Job
...
@@ -34,9 +34,17 @@ from Job import Job
class
OrderComponent
(
Job
):
# inherits from the Job class
class
OrderComponent
(
Job
):
# inherits from the Job class
type
=
"OrderComponent"
type
=
"OrderComponent"
def
__init__
(
self
,
id
=
None
,
name
=
None
,
route
=
[],
priority
=
0
,
dueDate
=
None
,
orderDate
=
None
,
extraPropertyDict
=
None
,
def
__init__
(
self
,
id
=
None
,
name
=
None
,
componentType
=
'Basic'
,
order
=
None
,
requestingComponent
=
None
,
route
=
[],
readyForAssembly
=
0
,
isCritical
=
False
):
priority
=
0
,
dueDate
=
None
,
orderDate
=
None
,
extraPropertyDict
=
None
,
componentType
=
'Basic'
,
order
=
None
,
requestingComponent
=
None
,
readyForAssembly
=
0
,
isCritical
=
False
):
Job
.
__init__
(
self
,
id
,
name
,
route
,
priority
,
dueDate
,
orderDate
,
extraPropertyDict
)
Job
.
__init__
(
self
,
id
,
name
,
route
,
priority
,
dueDate
,
orderDate
,
extraPropertyDict
)
self
.
auxiliaryList
=
[]
# Holds the auxiliary components that the component needs for a certain processing
self
.
auxiliaryList
=
[]
# Holds the auxiliary components that the component needs for a certain processing
self
.
order
=
order
# parent order of the order component
self
.
order
=
order
# parent order of the order component
...
...
dream/simulation/OrderDecomposition.py
View file @
41f8415a
...
@@ -192,9 +192,13 @@ class OrderDecomposition(CoreObject):
...
@@ -192,9 +192,13 @@ class OrderDecomposition(CoreObject):
# creates the components
# creates the components
# =======================================================================
# =======================================================================
def
createOrderComponent
(
self
,
component
):
def
createOrderComponent
(
self
,
component
):
#read attributes fromthe json or from the orderToBeDecomposed
#read attributes from
the json or from the orderToBeDecomposed
id
=
component
.
get
(
'id'
,
'not found'
)
id
=
component
.
get
(
'id'
,
'not found'
)
name
=
component
.
get
(
'name'
,
'not found'
)
name
=
component
.
get
(
'name'
,
'not found'
)
# there is the case were the component of the componentsList of the parent Order
# is of type Mould and therefore has no argument componentType
# in this case no Mould object should be initiated
try
:
# variable that holds the componentType which can be Basic/Secondary/Auxiliary
# variable that holds the componentType which can be Basic/Secondary/Auxiliary
componentType
=
component
.
get
(
'componentType'
,
'Basic'
)
componentType
=
component
.
get
(
'componentType'
,
'Basic'
)
# the component that needs the auxiliary (if the componentType is "Auxiliary") during its processing
# the component that needs the auxiliary (if the componentType is "Auxiliary") during its processing
...
@@ -206,7 +210,7 @@ class OrderDecomposition(CoreObject):
...
@@ -206,7 +210,7 @@ class OrderDecomposition(CoreObject):
for
routeentity
in
JSONRoute
:
# for each 'step' dictionary in the JSONRoute
for
routeentity
in
JSONRoute
:
# for each 'step' dictionary in the JSONRoute
stepNumber
=
int
(
routeentity
.
get
(
'stepNumber'
,
'0'
))
# get the stepNumber
stepNumber
=
int
(
routeentity
.
get
(
'stepNumber'
,
'0'
))
# get the stepNumber
# routeentity.pop(str(stepNumber),None) # remove the stepNumber key
# routeentity.pop(str(stepNumber),None) # remove the stepNumber key
route
[
stepNumber
]
=
routeentity
route
[
stepNumber
]
=
routeentity
# keep a reference of all extra properties passed to the job
# keep a reference of all extra properties passed to the job
...
@@ -219,7 +223,7 @@ class OrderDecomposition(CoreObject):
...
@@ -219,7 +223,7 @@ class OrderDecomposition(CoreObject):
#have to talk about it with NEX
#have to talk about it with NEX
exitAssigned
=
False
exitAssigned
=
False
for
element
in
route
:
for
element
in
route
:
# elementId=element[0]
# elementId=element[0]
elementIds
=
element
.
get
(
'stationIdsList'
,[])
elementIds
=
element
.
get
(
'stationIdsList'
,[])
for
obj
in
G
.
ObjList
:
for
obj
in
G
.
ObjList
:
for
elementId
in
elementIds
:
for
elementId
in
elementIds
:
...
@@ -232,7 +236,7 @@ class OrderDecomposition(CoreObject):
...
@@ -232,7 +236,7 @@ class OrderDecomposition(CoreObject):
exitId
=
obj
.
id
exitId
=
obj
.
id
break
break
if
exitId
:
if
exitId
:
# route.append([exitId, 0])
# route.append([exitId, 0])
route
.
append
({
'stationIdsList'
:[
str
(
exitId
)],
\
route
.
append
({
'stationIdsList'
:[
str
(
exitId
)],
\
'processingTime'
:{}})
'processingTime'
:{}})
...
@@ -261,4 +265,8 @@ class OrderDecomposition(CoreObject):
...
@@ -261,4 +265,8 @@ class OrderDecomposition(CoreObject):
G
.
EntityList
.
append
(
OC
)
G
.
EntityList
.
append
(
OC
)
self
.
newlyCreatedComponents
.
append
(
OC
)
#keep these to pass them to setWIP
self
.
newlyCreatedComponents
.
append
(
OC
)
#keep these to pass them to setWIP
OC
.
initialize
()
#initialize the component
OC
.
initialize
()
#initialize the component
except
:
# added for testing
print
'the component of the order'
,
sefl
.
orderToBeDecomposed
.
name
,
'is of type Mould
\
and thus nothing is created'
,
'time'
,
now
()
\ 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