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
189c43c4
Commit
189c43c4
authored
Feb 04, 2014
by
Georgios Dagkakis
Committed by
Jérome Perrin
Feb 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
objects that did inherit from Machine/QueuePreemptive changed to inherit from Machine/QueueJobShop
parent
dbb723e0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
21 deletions
+21
-21
dream/simulation/ConditionalBuffer.py
dream/simulation/ConditionalBuffer.py
+7
-7
dream/simulation/MouldAssembly.py
dream/simulation/MouldAssembly.py
+7
-7
dream/simulation/MouldAssemblyBuffer.py
dream/simulation/MouldAssemblyBuffer.py
+7
-7
No files found.
dream/simulation/ConditionalBuffer.py
View file @
189c43c4
...
...
@@ -22,10 +22,10 @@ Created on 15 Jan 2014
@author: Ioannis
'''
'''
Inherits from Queue
Preemptive
. Checks the condition of (a) component(s) before it can dispose them/it
Inherits from Queue
JobShop
. Checks the condition of (a) component(s) before it can dispose them/it
'''
from
Queue
Preemptive
import
QueuePreemptive
from
Queue
JobShop
import
QueueJobShop
from
SimPy.Simulation
import
now
# ===========================================================================
...
...
@@ -36,15 +36,15 @@ class NoCallerError(Exception):
Exception
.
__init__
(
self
,
callerError
)
# ===========================================================================
# the
QueuePreemptive
object
# the
ConditionalBuffer
object
# ===========================================================================
class
ConditionalBuffer
(
Queue
Preemptive
):
class
ConditionalBuffer
(
Queue
JobShop
):
# =======================================================================
# the default __init__ method of the Queue
Preemptive
class
# the default __init__ method of the Queue
JobShop
class
# whereas the default capacity is set to infinity
# =======================================================================
def
__init__
(
self
,
id
,
name
,
capacity
=-
1
,
dummy
=
False
,
schedulingRule
=
"FIFO"
):
Queue
Preemptive
.
__init__
(
self
,
id
=
id
,
name
=
name
,
capacity
=
capacity
,
dummy
=
dummy
,
schedulingRule
=
schedulingRule
)
Queue
JobShop
.
__init__
(
self
,
id
=
id
,
name
=
name
,
capacity
=
capacity
,
dummy
=
dummy
,
schedulingRule
=
schedulingRule
)
# =======================================================================
# checks if the Buffer can dispose an entity.
...
...
@@ -132,7 +132,7 @@ class ConditionalBuffer(QueuePreemptive):
def
sortEntities
(
self
):
activeObject
=
self
.
getActiveObject
()
# run the default sorting of the Queue first
Queue
Preemptive
.
sortEntities
(
self
)
Queue
JobShop
.
sortEntities
(
self
)
# and in the end sort according to the ConditionalBuffer sorting rule
activeObjectQueue
=
activeObject
.
getActiveObjectQueue
()
# if the componentType of the entities in the activeQueue is Basic then don't move it to the end of the activeQ
...
...
dream/simulation/MouldAssembly.py
View file @
189c43c4
...
...
@@ -22,7 +22,7 @@ Created on 16 Jan 2014
@author: Ioannis
'''
'''
inherits from Machine
Preemptive
. It takes the components of an order and reassembles them as mould
inherits from Machine
JobShop
. It takes the components of an order and reassembles them as mould
'''
'''
...
...
@@ -63,7 +63,7 @@ as a dictionary with the following layout if the mould is not already in WIP
There is no need to assign an exit, exit is assigned automatically by the createMould method
TODOs: check the case when a mould is already in the WIP by the beginning of the simulation
'''
from
Machine
Preemptive
import
MachinePreemptive
from
Machine
JobShop
import
MachineJobShop
from
SimPy.Simulation
import
Resource
,
reactivate
,
now
from
Globals
import
G
...
...
@@ -77,14 +77,14 @@ class AssembleMouldError(Exception):
# ===========================================================================
# the MachineJobShop object
# ===========================================================================
class
MouldAssembly
(
Machine
Preemptive
):
class
MouldAssembly
(
Machine
JobShop
):
# =======================================================================
# the initialize method
# =======================================================================
def
initialize
(
self
):
self
.
mouldParent
=
None
# the mould's to be assembled parent order
self
.
mouldToBeCreated
=
None
# the mould to be assembled
Machine
Preemptive
.
initialize
(
self
)
# run default behaviour
Machine
JobShop
.
initialize
(
self
)
# run default behaviour
# =======================================================================
# getEntity method that gets the entity from the giver
...
...
@@ -96,10 +96,10 @@ class MouldAssembly(MachinePreemptive):
activeObject
=
self
.
getActiveObject
()
giverObejct
=
activeObject
.
getGiverObject
()
# get the first entity from the predecessor
# TODO: each
machinePreemtive
.getEntity is invoked,
# TODO: each
MachineJobShop
.getEntity is invoked,
# the self.procTime is updated. Have to decide where to assign
# the processing time of the assembler
activeEntity
=
Machine
Preemptive
.
getEntity
(
self
)
activeEntity
=
Machine
JobShop
.
getEntity
(
self
)
# check weather the activeEntity is of type Mould
if
activeEntity
.
type
==
'Mould'
:
# and return the mould received
...
...
@@ -122,7 +122,7 @@ class MouldAssembly(MachinePreemptive):
# all the components are received at the same time
while
not
orderGroupReceived
:
# get the next component
activeEntity
=
Machine
Preemptive
.
getEntity
(
self
)
activeEntity
=
Machine
JobShop
.
getEntity
(
self
)
# check weather the activeEntity is of type Mould
try
:
if
activeEntity
.
type
==
'Mould'
:
...
...
dream/simulation/MouldAssemblyBuffer.py
View file @
189c43c4
...
...
@@ -22,11 +22,11 @@ Created on 15 Jan 2014
@author: Ioannis
'''
'''
Inherits from Queue
Preemptive
. It is the buffer before the MouldAssembly.
Inherits from Queue
JobShop
. It is the buffer before the MouldAssembly.
Only if all the mould (order) components are present, will it be able to dispose them
'''
from
Queue
Preemptive
import
QueuePreemptive
from
Queue
JobShop
import
QueueJobShop
from
SimPy.Simulation
import
now
# ===========================================================================
...
...
@@ -39,13 +39,13 @@ class NoCallerError(Exception):
# ===========================================================================
# the MouldAssemblyBuffer object
# ===========================================================================
class
MouldAssemblyBuffer
(
Queue
Preemptive
):
class
MouldAssemblyBuffer
(
Queue
JobShop
):
# =======================================================================
# the default __init__ method of the Queue
Preemptive
class
# the default __init__ method of the Queue
JobShop
class
# whereas the default capacity is set to infinity
# =======================================================================
def
__init__
(
self
,
id
,
name
,
capacity
=-
1
,
dummy
=
False
,
schedulingRule
=
"FIFO"
):
Queue
Preemptive
.
__init__
(
self
,
id
=
id
,
name
=
name
,
capacity
=
capacity
,
dummy
=
dummy
,
schedulingRule
=
schedulingRule
)
Queue
JobShop
.
__init__
(
self
,
id
=
id
,
name
=
name
,
capacity
=
capacity
,
dummy
=
dummy
,
schedulingRule
=
schedulingRule
)
# =======================================================================
# Sort the entities of the activeQ
...
...
@@ -54,7 +54,7 @@ class MouldAssemblyBuffer(QueuePreemptive):
def
sortEntities
(
self
):
activeObject
=
self
.
getActiveObject
()
# run the default sorting of the Queue first
Queue
Preemptive
.
sortEntities
(
self
)
Queue
JobShop
.
sortEntities
(
self
)
# and in the end sort according to the ConditionalBuffer sorting rule
activeObjectQueue
=
activeObject
.
getActiveObjectQueue
()
# if all the components of the same mould are present then move them to the front of the activeQ
...
...
@@ -77,7 +77,7 @@ class MouldAssemblyBuffer(QueuePreemptive):
def
getEntity
(
self
):
activeObject
=
self
.
getActiveObject
()
activeObjectQueue
=
activeObject
.
getActiveObjectQueue
()
activeEntity
=
Queue
Preemptive
.
getEntity
(
self
)
#execute default behaviour
activeEntity
=
Queue
JobShop
.
getEntity
(
self
)
#execute default behaviour
# if the activeEntity is of type orderComponent
try
:
if
activeEntity
.
componentType
==
'Basic'
or
'Secondary'
:
...
...
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