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
af2110cd
Commit
af2110cd
authored
Jun 06, 2014
by
Georgios Dagkakis
Committed by
Jérome Perrin
Jun 06, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
further fix in Source to output trace correctly
parent
1ee632de
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
13 deletions
+5
-13
dream/simulation/Source.py
dream/simulation/Source.py
+5
-13
No files found.
dream/simulation/Source.py
View file @
af2110cd
...
@@ -46,12 +46,6 @@ class EntityGenerator(object):
...
@@ -46,12 +46,6 @@ class EntityGenerator(object):
self
.
type
=
"EntityGenerator"
#String that shows the type of object
self
.
type
=
"EntityGenerator"
#String that shows the type of object
self
.
victim
=
victim
self
.
victim
=
victim
# #===========================================================================
# # initialize method of the EntityGenerator
# #===========================================================================
# def initialize(self):
# Process.__init__(self)
#===========================================================================
#===========================================================================
# the generator of the EntitiesGenerator
# the generator of the EntitiesGenerator
#===========================================================================
#===========================================================================
...
@@ -72,10 +66,9 @@ class EntityGenerator(object):
...
@@ -72,10 +66,9 @@ class EntityGenerator(object):
self
.
victim
.
entityCreated
.
succeed
(
entity
)
self
.
victim
.
entityCreated
.
succeed
(
entity
)
# else put it on the time list for scheduled Entities
# else put it on the time list for scheduled Entities
else
:
else
:
#print self.env.now, 'appending to the list'
entityCounter
=
G
.
numberOfEntities
+
len
(
self
.
victim
.
scheduledEntities
)
# this is used just ot output the trace correctly
self
.
victim
.
scheduledEntities
.
append
(
self
.
env
.
now
)
self
.
victim
.
scheduledEntities
.
append
(
self
.
env
.
now
)
self
.
victim
.
outputTrace
(
entity
.
name
,
"generated"
)
# output the trace
self
.
victim
.
outputTrace
(
self
.
victim
.
item
.
type
+
str
(
entityCounter
),
"generated"
)
# output the trace
G
.
numberOfEntities
+=
1
yield
self
.
env
.
timeout
(
self
.
victim
.
calculateInterarrivalTime
())
# wait until the next arrival
yield
self
.
env
.
timeout
(
self
.
victim
.
calculateInterarrivalTime
())
# wait until the next arrival
#============================================================================
#============================================================================
...
@@ -104,8 +97,7 @@ class Source(CoreObject):
...
@@ -104,8 +97,7 @@ class Source(CoreObject):
self
.
item
=
Globals
.
getClassFromName
(
entity
)
#the type of object that the Source will generate
self
.
item
=
Globals
.
getClassFromName
(
entity
)
#the type of object that the Source will generate
self
.
scheduledEntities
=
[]
# list of creations that are scheduled
self
.
scheduledEntities
=
[]
# list of creations that are scheduled. pattern is [timeOfCreation, EntityCounter]
#===========================================================================
#===========================================================================
# The initialize method of the Source class
# The initialize method of the Source class
...
...
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