Commit 13ab7dd7 authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

Job output updated so that also the delay is outputted. This is done only if a...

Job output updated so that also the delay is outputted. This is done only if a dueDate was given, and delay=compleationTime-dueDate
parent 95ec1331
......@@ -29,7 +29,7 @@ Class that acts as an abstract. It should have no instances. All the Entities sh
class Entity(object):
type="Entity"
def __init__(self, id=None, name=None, priority=0, dueDate=0, orderDate=0):
def __init__(self, id=None, name=None, priority=0, dueDate=None, orderDate=None):
self.name=name
# information on the object holding the entity
# initialized as None and updated every time an entity enters a new object
......
......@@ -69,21 +69,21 @@
"name": "Queue1",
"schedulingRule": "FIFO",
"isDummy": "0",
"capacity": "1000"
"capacity": "-1"
},
"Q2": {
"_class": "Dream.QueueJobShop",
"name": "Queue2",
"schedulingRule": "MC-Priority-EDD",
"isDummy": "0",
"capacity": "1000"
"capacity": "-1"
},
"Q3": {
"_class": "Dream.QueueJobShop",
"name": "Queue3",
"schedulingRule": "FIFO",
"isDummy": "0",
"capacity": "1000"
"capacity": "-1"
},
"E1": {
"_class": "Dream.ExitJobShop",
......@@ -93,7 +93,7 @@
"_class": "Dream.Job",
"name": "Job1",
"priority": "1",
"dueDate": "900",
"dueDate": "15",
"orderDate": "0",
"route": [
{
......@@ -134,7 +134,7 @@
"_class": "Dream.Job",
"name": "Job2",
"priority": "-7",
"dueDate": "100",
"dueDate": "10",
"orderDate": "-1",
"route": [
{
......@@ -175,7 +175,7 @@
"_class": "Dream.Job",
"name": "Job3",
"priority": "-12",
"dueDate": "60",
"dueDate": "6",
"orderDate": "2",
"route": [
{
......@@ -208,7 +208,7 @@
"_class": "Dream.Job",
"name": "Job4",
"priority": "0",
"dueDate": "99",
"dueDate": "9",
"orderDate": "1.5",
"route": [
{
......
......@@ -33,7 +33,7 @@ from Entity import Entity
class Job(Entity): # inherits from the Entity class
type="Job"
def __init__(self, id=None, name=None, route=[], priority=0, dueDate=0, orderDate=0):
def __init__(self, id=None, name=None, route=[], priority=0, dueDate=None, orderDate=None):
Entity.__init__(self, id=id,name=name, priority=priority, dueDate=dueDate, orderDate=orderDate)
# instance specific attributes
self.id=id # id
......@@ -51,16 +51,22 @@ class Job(Entity): # inherits from the Entity c
from Globals import G
if(G.numberOfReplications==1): #if we had just one replication output the results to excel
json={} # dictionary holding information related to the specific entity
json['_class'] = 'Dream.Job';
json['_class'] = 'Dream.Job'
json['id'] = str(self.id)
json['results'] = {}
#if the Job has reached an exit, input completion time in the results
if self.schedule[-1][0].type=='Exit':
json['results']['completionTime']=self.schedule[-1][1]
json['results']['completionTime']=self.schedule[-1][1]
completionTime=self.schedule[-1][1]
#else input "still in progress"
else:
json['results']['completionTime']="still in progress"
json['results']['completionTime']="still in progress"
completionTime=None
if completionTime and self.dueDate:
delay=completionTime-self.dueDate
json['results']['delay']=delay
json['results']['schedule']={}
i=0
......
......@@ -13,6 +13,7 @@
"_class": "Dream.Job",
"id": "J1",
"results": {
"delay": 8.0,
"completionTime": 23.0,
"schedule": {
"1": {
......@@ -50,6 +51,7 @@
"_class": "Dream.Job",
"id": "J2",
"results": {
"delay": 9.0,
"completionTime": 19.0,
"schedule": {
"1": {
......@@ -87,6 +89,7 @@
"_class": "Dream.Job",
"id": "J3",
"results": {
"delay": -1.0,
"completionTime": 5.0,
"schedule": {
"1": {
......@@ -116,6 +119,7 @@
"_class": "Dream.Job",
"id": "J4",
"results": {
"delay": 3.0,
"completionTime": 12.0,
"schedule": {
"1": {
......
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