Commit 39743610 authored by Jérome Perrin's avatar Jérome Perrin

Jobshop: really use dueDate information

parent 9e5224dc
...@@ -47,7 +47,7 @@ class Simulation(DefaultSimulation): ...@@ -47,7 +47,7 @@ class Simulation(DefaultSimulation):
if elementClass=='Dream.Job': if elementClass=='Dream.Job':
results=element['results'] results=element['results']
delay = float(results.get('delay', "0")) delay = float(results.get('delay', "0"))
totalDelay+=delay totalDelay += delay
return totalDelay return totalDelay
......
...@@ -3,6 +3,7 @@ import json ...@@ -3,6 +3,7 @@ import json
import time import time
import random import random
import operator import operator
from datetime import datetime
from dream.simulation.GUI import ACO from dream.simulation.GUI import ACO
from dream.simulation.GUI.Default import schema from dream.simulation.GUI.Default import schema
...@@ -38,11 +39,16 @@ class Simulation(ACO.Simulation): ...@@ -38,11 +39,16 @@ class Simulation(ACO.Simulation):
""" Set the WIP in queue from spreadsheet data. """ Set the WIP in queue from spreadsheet data.
""" """
data = copy(in_data) data = copy(in_data)
# XXX have now a global option ?
now = datetime.now()
if 'wip_spreadsheet' in data: if 'wip_spreadsheet' in data:
wip_dict = {} wip_dict = {}
for value_list in data['wip_spreadsheet']: for value_list in data['wip_spreadsheet']:
if value_list[1] == 'ID' or not value_list[1]: if value_list[1] == 'ID' or not value_list[1]:
continue continue
dueDate = (datetime.strptime(value_list[3], '%Y/%m/%d') - now).days
sequence_list = value_list[6].split('-') sequence_list = value_list[6].split('-')
processing_time_list = value_list[7].split('-') processing_time_list = value_list[7].split('-')
wip_dict.setdefault(sequence_list[0], []).append( wip_dict.setdefault(sequence_list[0], []).append(
...@@ -50,12 +56,7 @@ class Simulation(ACO.Simulation): ...@@ -50,12 +56,7 @@ class Simulation(ACO.Simulation):
"_class": "Dream.Job", "_class": "Dream.Job",
"id": value_list[1], "id": value_list[1],
"name": value_list[0], "name": value_list[0],
"order_date": value_list[2], "dueDate": dueDate,
"due_date": value_list[3],
# TODO: calculate due date properly (based on simulation date ?)
"dueDate": 1,
"priority": value_list[4],
"material": value_list[5],
"route": [ "route": [
{ {
"processingTime": { "processingTime": {
......
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