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
6ccd5026
Commit
6ccd5026
authored
Dec 22, 2014
by
Georgios Dagkakis
Committed by
Ioannis Papagiannopoulos
Jan 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
corrections and tests
parent
8cdf3ca8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
dream/simulation/RandomNumberGenerator.py
dream/simulation/RandomNumberGenerator.py
+10
-0
dream/simulation/Source.py
dream/simulation/Source.py
+1
-1
No files found.
dream/simulation/RandomNumberGenerator.py
View file @
6ccd5026
...
...
@@ -38,6 +38,16 @@ class RandomNumberGenerator(object):
# ...
# },
def
__init__
(
self
,
obj
,
distribution
):
# check in case an inknown distrbution was given
unknownDistribution
=
True
for
key
in
distribution
.
keys
():
if
key
in
[
'Fixed'
,
'Normal'
,
'Exp'
,
'Gamma'
,
'Logistic'
,
'Erlang'
,
'Geometric'
,
'Lognormal'
,
'Weibull'
,
'Cauchy'
]:
unknownDistribution
=
False
break
if
unknownDistribution
:
raise
ValueError
(
"Unknown distribution %r used in %s %s"
%
(
distribution
,
obj
.
__class__
,
obj
.
id
))
# pop irrelevant keys
for
key
in
distribution
.
keys
():
if
key
not
in
[
'Fixed'
,
'Normal'
,
'Exp'
,
'Gamma'
,
'Logistic'
,
'Erlang'
,
...
...
dream/simulation/Source.py
View file @
6ccd5026
...
...
@@ -84,7 +84,7 @@ class Source(CoreObject):
def
__init__
(
self
,
id
,
name
,
interArrivalTime
=
None
,
entity
=
'Dream.Part'
,
**
kw
):
# Default values
if
not
interArrivalTime
:
interArrivalTime
=
{
'
distributionType'
:
'Fixed'
,
'mean'
:
1
}
interArrivalTime
=
{
'
Fixed'
:
{
'mean'
:
1
}
}
if
'Normal'
in
interArrivalTime
.
keys
()
and
\
interArrivalTime
[
'Normal'
].
get
(
'max'
,
None
)
is
None
:
interArrivalTime
[
'Normal'
][
'max'
]
=
interArrivalTime
[
'Normal'
][
'mean'
]
+
5
*
interArrivalTime
[
'Normal'
][
'stdev'
]
...
...
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