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
453e668d
Commit
453e668d
authored
Apr 09, 2015
by
panos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fixed in the script
parent
8f8c3b40
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
dream/KnowledgeExtraction/PilotCases/JobShop/DateTimeConvert.py
...KnowledgeExtraction/PilotCases/JobShop/DateTimeConvert.py
+7
-2
No files found.
dream/KnowledgeExtraction/PilotCases/JobShop/DateTimeConvert.py
View file @
453e668d
...
...
@@ -37,10 +37,14 @@ class DateTimeConvert(plugin.InputPreparationPlugin, TimeSupportMixin):
proc_time
=
0
;
timeOut
=
entity
.
pop
(
'timeOut'
,
None
)
timeIn
=
entity
.
pop
(
'timeIn'
,
'NA'
)
if
not
timeIn
==
'NA'
:
timeIn
=
strptime
(
timeIn
,
'%Y-%m-%d %H:%M:%S'
)
if
timeOut
:
entity
[
'remainingProcessingTime'
]
=
0
else
:
#calculate the time difference between the TIMEIN and the moment the user wants to run the simulation (e.g. datetime.now())
print
type
(
now
)
print
type
(
timeIn
)
timeDelta
=
now
-
timeIn
if
self
.
timeUnit
==
'second'
:
timeDiff
=
timeDelta
.
total_seconds
()
#24 * 60 * 60
...
...
@@ -57,7 +61,7 @@ class DateTimeConvert(plugin.InputPreparationPlugin, TimeSupportMixin):
elif
self
.
timeUnit
==
'year'
:
timeDiff
=
timeDelta
.
total_seconds
()
/
(
60
*
60
*
24
*
7
*
30
*
360
)
#1 / 360.
else
:
raise
ValueError
(
"Unsupported time unit %s"
%
timeUnit
)
raise
ValueError
(
"Unsupported time unit %s"
%
self
.
timeUnit
)
for
order
in
orders
:
comps
=
order
.
get
(
'componentsList'
,
[])
...
...
@@ -65,7 +69,8 @@ class DateTimeConvert(plugin.InputPreparationPlugin, TimeSupportMixin):
if
comp
[
'id'
]
==
ent_key
:
for
step
in
comp
.
get
(
'route'
,
[]):
if
step
.
get
(
'task_id'
,
None
)
==
task_id
:
proc_time
=
step
.
get
(
'processingTime'
,
None
)
proc_time
=
step
.
get
(
'processingTime'
,
{}).
get
(
'Fixed'
,{}).
get
(
'mean'
,
0
)
print
proc_time
break
if
proc_time
:
break
...
...
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