Commit 19784fcb authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Jérome Perrin

isCritical property moved to Entity

parent 1eb1a536
...@@ -31,7 +31,7 @@ Class that acts as an abstract. It should have no instances. All the Entities sh ...@@ -31,7 +31,7 @@ Class that acts as an abstract. It should have no instances. All the Entities sh
class Entity(object): class Entity(object):
type="Entity" type="Entity"
def __init__(self, id=None, name=None, priority=0, dueDate=None, orderDate=None): def __init__(self, id=None, name=None, priority=0, dueDate=None, orderDate=None, isCritical=False):
self.name=name self.name=name
# information on the object holding the entity # information on the object holding the entity
# initialized as None and updated every time an entity enters a new object # initialized as None and updated every time an entity enters a new object
...@@ -52,6 +52,7 @@ class Entity(object): ...@@ -52,6 +52,7 @@ class Entity(object):
self.currentStation=None self.currentStation=None
# values to be used in the internal processing of compoundObjects # values to be used in the internal processing of compoundObjects
self.internal = False # informs if the entity is being processed internally self.internal = False # informs if the entity is being processed internally
self.isCritical=isCritical # flag to inform weather the entity is critical -> preemption
# ======================================================================= # =======================================================================
# outputs results to JSON File # outputs results to JSON File
# ======================================================================= # =======================================================================
......
...@@ -35,8 +35,8 @@ from Entity import Entity ...@@ -35,8 +35,8 @@ from Entity import Entity
class Job(Entity): # inherits from the Entity class class Job(Entity): # inherits from the Entity class
type="Job" type="Job"
def __init__(self, id=None, name=None, route=[], priority=0, dueDate=None, orderDate=None, extraPropertyDict=None): def __init__(self, id=None, name=None, route=[], priority=0, dueDate=None, orderDate=None, extraPropertyDict=None,isCritical=False):
Entity.__init__(self, id=id,name=name, priority=priority, dueDate=dueDate, orderDate=orderDate) Entity.__init__(self, id=id,name=name, priority=priority, dueDate=dueDate, orderDate=orderDate, isCritical=isCritical)
# instance specific attributes # instance specific attributes
self.id=id # id self.id=id # id
# information on the routing and the stops of the entity # information on the routing and the stops of the entity
......
...@@ -43,6 +43,6 @@ class Mould(Job): # inherits from the Job class ...@@ -43,6 +43,6 @@ class Mould(Job): # inherits from the Job class
extraPropertyDict=None, extraPropertyDict=None,
order=None, order=None,
isCritical=False): isCritical=False):
Job.__init__(self, id, name, route, priority, dueDate, orderDate, extraPropertyDict) Job.__init__(self, id, name, route, priority, dueDate, orderDate, extraPropertyDict, isCritical)
self.order=order # parent order of the order component self.order=order # parent order of the order component
self.isCritical=isCritical # this should be self.order.isCritical. Added now for testing # self.isCritical=isCritical # this should be self.order.isCritical. Added now for testing
\ No newline at end of file \ No newline at end of file
...@@ -48,7 +48,7 @@ class Order(Job): ...@@ -48,7 +48,7 @@ class Order(Job):
extraPropertyDict=None): 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
self.componentsList=componentsList # list of components that the order will be broken into self.componentsList=componentsList # list of components that the order will be broken into
self.basicComponentsList = [] # list that holds the Basic Components of the order self.basicComponentsList = [] # list that holds the Basic Components of the order
self.secondaryComponentsList = [] # list that holds the Secondary Components of the order self.secondaryComponentsList = [] # list that holds the Secondary Components of the order
......
...@@ -45,10 +45,10 @@ class OrderComponent(Job): # inherits from the ...@@ -45,10 +45,10 @@ class OrderComponent(Job): # inherits from the
requestingComponent = None, requestingComponent = None,
readyForAssembly = 0, readyForAssembly = 0,
isCritical=False): isCritical=False):
Job.__init__(self, id, name, route, priority, dueDate, orderDate, extraPropertyDict) Job.__init__(self, id, name, route, priority, dueDate, orderDate, extraPropertyDict, isCritical)
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
self.isCritical=isCritical # this should be self.order.isCritical. Added now for testing # self.isCritical=isCritical # this should be self.order.isCritical. Added now for testing
self.componentType = componentType # the type of the component which can be Basic/Secondary/Auxiliary self.componentType = componentType # the type of the component which can be Basic/Secondary/Auxiliary
# if the componentType of the component is Auxiliary then there need a requesting Component be defined # 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 requestingComponent is the component that needs the auxiliary component during its processing
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment