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
34b02de8
Commit
34b02de8
authored
Mar 19, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
additions so that break interrupts the victim
parent
9b24d077
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
41 deletions
+37
-41
dream/simulation/Break.py
dream/simulation/Break.py
+32
-38
dream/simulation/ObjectResource.py
dream/simulation/ObjectResource.py
+5
-1
dream/simulation/Operator.py
dream/simulation/Operator.py
+0
-2
No files found.
dream/simulation/Break.py
View file @
34b02de8
This diff is collapsed.
Click to expand it.
dream/simulation/ObjectResource.py
View file @
34b02de8
...
@@ -47,6 +47,10 @@ class ObjectResource(ManPyObject):
...
@@ -47,6 +47,10 @@ class ObjectResource(ManPyObject):
def
initialize
(
self
):
def
initialize
(
self
):
from
Globals
import
G
from
Globals
import
G
# flag that shows if the resource is on shift
self
.
onShift
=
True
# flag that shows if the resource is on break
self
.
onBreak
=
False
self
.
env
=
G
.
env
self
.
env
=
G
.
env
self
.
timeLastOperationStarted
=
0
#holds the time that the last repair was started
self
.
timeLastOperationStarted
=
0
#holds the time that the last repair was started
self
.
Res
=
simpy
.
Resource
(
self
.
env
,
capacity
=
self
.
capacity
)
self
.
Res
=
simpy
.
Resource
(
self
.
env
,
capacity
=
self
.
capacity
)
...
@@ -67,7 +71,7 @@ class ObjectResource(ManPyObject):
...
@@ -67,7 +71,7 @@ class ObjectResource(ManPyObject):
# =======================================================================
# =======================================================================
def
checkIfResourceIsAvailable
(
self
,
callerObject
=
None
):
def
checkIfResourceIsAvailable
(
self
,
callerObject
=
None
):
# return true if the operator is idle and on shift
# return true if the operator is idle and on shift
return
len
(
self
.
Res
.
users
)
<
self
.
capacity
and
self
.
onShift
and
(
not
self
.
isLocked
)
return
len
(
self
.
Res
.
users
)
<
self
.
capacity
and
self
.
onShift
and
(
not
self
.
isLocked
)
and
(
not
self
.
onBreak
)
# =======================================================================
# =======================================================================
...
...
dream/simulation/Operator.py
View file @
34b02de8
...
@@ -97,8 +97,6 @@ class Operator(ObjectResource):
...
@@ -97,8 +97,6 @@ class Operator(ObjectResource):
def
initialize
(
self
):
def
initialize
(
self
):
ObjectResource
.
initialize
(
self
)
ObjectResource
.
initialize
(
self
)
# flag that shows if the resource is on shift
self
.
onShift
=
True
self
.
totalWorkingTime
=
0
#holds the total working time
self
.
totalWorkingTime
=
0
#holds the total working time
self
.
totalWaitingTime
=
0
#holds the total waiting time
self
.
totalWaitingTime
=
0
#holds the total waiting time
self
.
totalOffShiftTime
=
0
#holds the total off-shift time
self
.
totalOffShiftTime
=
0
#holds the total off-shift time
...
...
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