Commit f52fa83f authored by Georgios Dagkakis's avatar Georgios Dagkakis

Jobs definition in the new way. 3 tests fail

parent 37a13947
...@@ -34,7 +34,7 @@ from Entity import Entity ...@@ -34,7 +34,7 @@ from Entity import Entity
class CapacityEntity(Entity): class CapacityEntity(Entity):
type="CapacityEntity" type="CapacityEntity"
def __init__(self, id=None, name=None, capacityProjectId=None, requiredCapacity=10, priority=0, dueDate=None, orderDate=None, isCritical=False): def __init__(self, id=None, name=None, capacityProjectId=None, requiredCapacity=10, priority=0, dueDate=0, orderDate=0, isCritical=False):
Entity.__init__(self, id, name, priority, dueDate, orderDate, isCritical) Entity.__init__(self, id, name, priority, dueDate, orderDate, isCritical)
self.capacityProjectId=capacityProjectId # the project id hat the capacity Entity is part of self.capacityProjectId=capacityProjectId # the project id hat the capacity Entity is part of
self.capacityProject=None # the project that the capacity Entity is part of. It is defined in initialize self.capacityProject=None # the project that the capacity Entity is part of. It is defined in initialize
......
...@@ -34,7 +34,7 @@ import simpy ...@@ -34,7 +34,7 @@ import simpy
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=0, orderDate=0,
isCritical=False, remainingProcessingTime=0): isCritical=False, remainingProcessingTime=0):
self.name=name self.name=name
self.id=id self.id=id
...@@ -48,16 +48,21 @@ class Entity(object): ...@@ -48,16 +48,21 @@ class Entity(object):
self.height=1.0 self.height=1.0
self.length=1.0 self.length=1.0
# information concerning the sorting of the entities inside (for example) queues # information concerning the sorting of the entities inside (for example) queues
self.priority=priority self.priority=float(priority)
self.dueDate=dueDate self.dueDate=float(dueDate)
self.orderDate=orderDate self.orderDate=float(orderDate)
# a list that holds information about the schedule # a list that holds information about the schedule
# of the entity (when it enters and exits every station) # of the entity (when it enters and exits every station)
self.schedule=[] self.schedule=[]
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 if isinstance(isCritical, unicode):
self.isCritical=bool(int(isCritical))
elif isinstance(isCritical, int):
self.isCritical=bool(isCritical) # flag to inform weather the entity is critical -> preemption
else:
self.isCritical=isCritical
self.manager=None # default value self.manager=None # default value
self.numberOfUnits=1 # default value self.numberOfUnits=1 # default value
# variable used to differentiate entities with and entities without routes # variable used to differentiate entities with and entities without routes
...@@ -70,6 +75,7 @@ class Entity(object): ...@@ -70,6 +75,7 @@ class Entity(object):
# alias used for printing the Route # alias used for printing the Route
self.alias=None self.alias=None
self.remainingProcessingTime=remainingProcessingTime self.remainingProcessingTime=remainingProcessingTime
print self.id
# ======================================================================= # =======================================================================
# outputs results to JSON File # outputs results to JSON File
......
...@@ -72,11 +72,8 @@ ...@@ -72,11 +72,8 @@
"wip": [ "wip": [
{ {
"_class": "Dream.Job", "_class": "Dream.Job",
"due_date": "2013-12-15",
"id": "J1", "id": "J1",
"material": "Plastic",
"name": "Order 1 from X", "name": "Order 1 from X",
"order_date": "2013-11-20",
"priority": "2", "priority": "2",
"route": [ "route": [
{ {
...@@ -114,6 +111,11 @@ ...@@ -114,6 +111,11 @@
"stationIdsList": [ "stationIdsList": [
"M3" "M3"
] ]
},
{
"stationIdsList": [
"E1"
]
} }
] ]
} }
...@@ -127,11 +129,8 @@ ...@@ -127,11 +129,8 @@
"wip": [ "wip": [
{ {
"_class": "Dream.Job", "_class": "Dream.Job",
"due_date": "2013-11-30",
"id": "J2", "id": "J2",
"material": "Aluminium",
"name": "Order 2 from Y", "name": "Order 2 from Y",
"order_date": "2013-11-14",
"priority": "1", "priority": "1",
"route": [ "route": [
{ {
...@@ -169,6 +168,11 @@ ...@@ -169,6 +168,11 @@
"stationIdsList": [ "stationIdsList": [
"M1" "M1"
] ]
},
{
"stationIdsList": [
"E1"
]
} }
] ]
} }
...@@ -182,11 +186,8 @@ ...@@ -182,11 +186,8 @@
"wip": [ "wip": [
{ {
"_class": "Dream.Job", "_class": "Dream.Job",
"due_date": "2014-02-01",
"id": "J3", "id": "J3",
"material": "Plastic",
"name": "Order 3 from Z", "name": "Order 3 from Z",
"order_date": "2013-11-03",
"priority": "3", "priority": "3",
"route": [ "route": [
{ {
...@@ -224,6 +225,11 @@ ...@@ -224,6 +225,11 @@
"stationIdsList": [ "stationIdsList": [
"M1" "M1"
] ]
},
{
"stationIdsList": [
"E1"
]
} }
] ]
} }
......
...@@ -85,6 +85,11 @@ ...@@ -85,6 +85,11 @@
"stationIdsList": [ "stationIdsList": [
"M2" "M2"
] ]
},
{
"stationIdsList": [
"E1"
]
} }
] ]
} }
...@@ -120,6 +125,11 @@ ...@@ -120,6 +125,11 @@
"stationIdsList": [ "stationIdsList": [
"M2" "M2"
] ]
},
{
"stationIdsList": [
"E1"
]
} }
] ]
} }
......
...@@ -85,6 +85,11 @@ ...@@ -85,6 +85,11 @@
"stationIdsList": [ "stationIdsList": [
"M2" "M2"
] ]
},
{
"stationIdsList": [
"E1"
]
} }
] ]
} }
...@@ -120,6 +125,11 @@ ...@@ -120,6 +125,11 @@
"stationIdsList": [ "stationIdsList": [
"M2" "M2"
] ]
},
{
"stationIdsList": [
"E1"
]
} }
] ]
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"confidenceLevel": "0.95", "confidenceLevel": "0.95",
"maxSimTime": "-1", "maxSimTime": "-1",
"numberOfReplications": "1", "numberOfReplications": "1",
"trace": "No" "trace": "Yes"
}, },
"nodes": { "nodes": {
"AB1": { "AB1": {
......
...@@ -137,6 +137,11 @@ ...@@ -137,6 +137,11 @@
"stationIdsList": [ "stationIdsList": [
"M2" "M2"
] ]
},
{
"stationIdsList": [
"E1"
]
} }
] ]
} }
...@@ -197,6 +202,11 @@ ...@@ -197,6 +202,11 @@
"stationIdsList": [ "stationIdsList": [
"M4" "M4"
] ]
},
{
"stationIdsList": [
"E1"
]
} }
] ]
} }
......
...@@ -136,6 +136,11 @@ ...@@ -136,6 +136,11 @@
"stationIdsList": [ "stationIdsList": [
"EDM" "EDM"
] ]
},
{
"stationIdsList": [
"E1"
]
} }
] ]
}, },
...@@ -181,6 +186,11 @@ ...@@ -181,6 +186,11 @@
"stationIdsList": [ "stationIdsList": [
"EDM" "EDM"
] ]
},
{
"stationIdsList": [
"E1"
]
} }
] ]
}, },
...@@ -226,6 +236,11 @@ ...@@ -226,6 +236,11 @@
"stationIdsList": [ "stationIdsList": [
"EDM" "EDM"
] ]
},
{
"stationIdsList": [
"E1"
]
} }
] ]
}, },
...@@ -271,6 +286,11 @@ ...@@ -271,6 +286,11 @@
"stationIdsList": [ "stationIdsList": [
"EDM" "EDM"
] ]
},
{
"stationIdsList": [
"E1"
]
} }
] ]
}, },
...@@ -297,6 +317,11 @@ ...@@ -297,6 +317,11 @@
"stationIdsList": [ "stationIdsList": [
"M1" "M1"
] ]
},
{
"stationIdsList": [
"E1"
]
} }
] ]
} }
......
...@@ -96,6 +96,11 @@ ...@@ -96,6 +96,11 @@
"M2" "M2"
], ],
"stepNumber": "3" "stepNumber": "3"
},
{
"stationIdsList": [
"E1"
]
} }
] ]
} }
...@@ -133,6 +138,11 @@ ...@@ -133,6 +138,11 @@
"M2" "M2"
], ],
"stepNumber": "1" "stepNumber": "1"
},
{
"stationIdsList": [
"E1"
]
} }
] ]
} }
......
...@@ -36,7 +36,7 @@ class Job(Entity): # inherits from the Entity c ...@@ -36,7 +36,7 @@ class Job(Entity): # inherits from the Entity c
type='Job' type='Job'
family='Job' family='Job'
def __init__(self, id=None, name=None, route=[], priority=0, dueDate=None, orderDate=None, extraPropertyDict=None,isCritical=False): def __init__(self, id=None, name=None, route=[], priority=0, dueDate=0, orderDate=0, extraPropertyDict=None,isCritical=False):
Entity.__init__(self, id=id,name=name, priority=priority, dueDate=dueDate, orderDate=orderDate, isCritical=isCritical) Entity.__init__(self, id=id,name=name, priority=priority, dueDate=dueDate, orderDate=orderDate, isCritical=isCritical)
# instance specific attributes # instance specific attributes
# information on the routing and the stops of the entity # information on the routing and the stops of the entity
...@@ -44,9 +44,6 @@ class Job(Entity): # inherits from the Entity c ...@@ -44,9 +44,6 @@ class Job(Entity): # inherits from the Entity c
# also contains the processing times in each station # also contains the processing times in each station
self.remainingRoute=list(route) # the remaining route. in the beginning self.remainingRoute=list(route) # the remaining route. in the beginning
# this should be the same as the full route # this should be the same as the full route
# the scheduling of the entity as resolved by the simulation
# self.schedule=[] # keeps the result of the simulation.
# # A list with the stations and time of entrance
self.extraPropertyDict = extraPropertyDict self.extraPropertyDict = extraPropertyDict
# variable used to differentiate entities with and entities without routes # variable used to differentiate entities with and entities without routes
self.family='Job' self.family='Job'
......
This diff is collapsed.
...@@ -62,3 +62,5 @@ class Order(Job): ...@@ -62,3 +62,5 @@ class Order(Job):
# used by printRoute # used by printRoute
self.alias='O'+str(len(G.OrderList)) self.alias='O'+str(len(G.OrderList))
def createRoute(self, route):
return route
\ No newline at end of file
...@@ -37,8 +37,8 @@ class OrderComponent(Job): # inherits from the ...@@ -37,8 +37,8 @@ class OrderComponent(Job): # inherits from the
def __init__(self, id=None, name=None, def __init__(self, id=None, name=None,
route=[], route=[],
priority=0, priority=0,
dueDate=None, dueDate=0,
orderDate=None, orderDate=0,
extraPropertyDict=None, extraPropertyDict=None,
componentType='Basic', componentType='Basic',
order=None, order=None,
...@@ -66,4 +66,3 @@ class OrderComponent(Job): # inherits from the ...@@ -66,4 +66,3 @@ class OrderComponent(Job): # inherits from the
# used by printRoute # used by printRoute
if self.order: if self.order:
self.alias=self.order.alias+'C'+str(len(G.OrderComponentList)) self.alias=self.order.alias+'C'+str(len(G.OrderComponentList))
\ No newline at end of file
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