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
4a66a23a
Commit
4a66a23a
authored
Jan 14, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
operator to ouput schedule
parent
0b842589
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
dream/simulation/Operator.py
dream/simulation/Operator.py
+8
-1
No files found.
dream/simulation/Operator.py
View file @
4a66a23a
...
...
@@ -37,7 +37,7 @@ from ObjectResource import ObjectResource
class
Operator
(
ObjectResource
):
family
=
'Operator'
def
__init__
(
self
,
id
,
name
,
capacity
=
1
,
schedulingRule
=
'FIFO'
,
skills
=
[],
available
=
True
,
**
kw
):
def
__init__
(
self
,
id
,
name
,
capacity
=
1
,
schedulingRule
=
'FIFO'
,
skills
=
[],
available
=
True
,
ouputSchedule
=
False
,
**
kw
):
ObjectResource
.
__init__
(
self
,
id
=
id
,
name
=
name
)
self
.
objName
=
name
self
.
capacity
=
int
(
capacity
)
# repairman is an instance of resource
...
...
@@ -83,6 +83,8 @@ class Operator(ObjectResource):
self
.
available
=
available
from
Globals
import
G
G
.
OperatorsList
.
append
(
self
)
# flag to show if the operator will output his schedule in the results
self
.
ouputSchedule
=
ouputSchedule
def
initialize
(
self
):
ObjectResource
.
initialize
(
self
)
...
...
@@ -330,6 +332,11 @@ class Operator(ObjectResource):
json
[
'results'
][
'working_ratio'
]
=
getConfidenceIntervals
(
self
.
Working
)
json
[
'results'
][
'waiting_ratio'
]
=
getConfidenceIntervals
(
self
.
Waiting
)
json
[
'results'
][
'off_shift_ratio'
]
=
getConfidenceIntervals
(
self
.
OffShift
)
if
self
.
ouputSchedule
:
if
self
.
schedule
:
json
[
'results'
][
'schedule'
]
=
[]
for
record
in
self
.
schedule
:
json
[
'results'
][
'schedule'
].
append
({
'stationId'
:
record
[
0
].
id
,
'time'
:
record
[
1
]})
G
.
outputJSON
[
'elementList'
].
append
(
json
)
#===========================================================================
...
...
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