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
d80b1fbd
Commit
d80b1fbd
authored
Sep 30, 2013
by
Georgios Dagkakis
Committed by
Sebastien Robin
Sep 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Queue object updated so that it also outputs trace
parent
29802823
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
dream/simulation/CoreObject.py
dream/simulation/CoreObject.py
+1
-1
dream/simulation/JSONInputs/Topology12.json
dream/simulation/JSONInputs/Topology12.json
+1
-1
dream/simulation/Queue.py
dream/simulation/Queue.py
+9
-1
No files found.
dream/simulation/CoreObject.py
View file @
d80b1fbd
...
@@ -72,7 +72,7 @@ class CoreObject(Process):
...
@@ -72,7 +72,7 @@ class CoreObject(Process):
#removes an entity from the Object
#removes an entity from the Object
def
removeEntity
(
self
):
def
removeEntity
(
self
):
self
.
Res
.
activeQ
.
pop
(
0
)
self
.
Res
.
activeQ
.
pop
(
0
)
#gets an entity from the predecessor that the predecessor index points to
#gets an entity from the predecessor that the predecessor index points to
def
getEntity
(
self
):
def
getEntity
(
self
):
...
...
dream/simulation/JSONInputs/Topology12.json
View file @
d80b1fbd
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
"_class"
:
"Dream.Configuration"
,
"_class"
:
"Dream.Configuration"
,
"numberOfReplications"
:
"1"
,
"numberOfReplications"
:
"1"
,
"maxSimTime"
:
"1440"
,
"maxSimTime"
:
"1440"
,
"trace"
:
"
No
"
,
"trace"
:
"
Yes
"
,
"confidenceLevel"
:
"0.95"
"confidenceLevel"
:
"0.95"
},
},
"elementList"
:
[
"elementList"
:
[
...
...
dream/simulation/Queue.py
View file @
d80b1fbd
...
@@ -83,7 +83,9 @@ class Queue(CoreObject):
...
@@ -83,7 +83,9 @@ class Queue(CoreObject):
while
1
:
while
1
:
yield
waituntil
,
self
,
self
.
canAcceptAndIsRequested
#wait until the Queue can accept an entity
yield
waituntil
,
self
,
self
.
canAcceptAndIsRequested
#wait until the Queue can accept an entity
#and one predecessor requests it
#and one predecessor requests it
self
.
getEntity
()
self
.
getEntity
()
self
.
outputTrace
(
"got into "
+
self
.
objName
)
#if entity just got to the dummyQ set its startTime as the current time
#if entity just got to the dummyQ set its startTime as the current time
if
self
.
isDummy
:
if
self
.
isDummy
:
...
@@ -137,6 +139,12 @@ class Queue(CoreObject):
...
@@ -137,6 +139,12 @@ class Queue(CoreObject):
flag
=
True
flag
=
True
return
len
(
self
.
Res
.
activeQ
)
>
0
and
flag
return
len
(
self
.
Res
.
activeQ
)
>
0
and
flag
#removes an entity from the Object
def
removeEntity
(
self
):
self
.
outputTrace
(
"releases "
+
self
.
objName
)
self
.
Res
.
activeQ
.
pop
(
0
)
#checks if the Queue can accept an entity and there is an entity in some predecessor waiting for it
#checks if the Queue can accept an entity and there is an entity in some predecessor waiting for it
#also updates the predecessorIndex to the one that is to be taken
#also updates the predecessorIndex to the one that is to be taken
def
canAcceptAndIsRequested
(
self
):
def
canAcceptAndIsRequested
(
self
):
...
...
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