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
e5ddce48
Commit
e5ddce48
authored
Oct 21, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new attributes set for RandomNumberGenerator
parent
aea2932a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
dream/simulation/RandomNumberGenerator.py
dream/simulation/RandomNumberGenerator.py
+10
-1
No files found.
dream/simulation/RandomNumberGenerator.py
View file @
e5ddce48
...
@@ -26,7 +26,8 @@ Created on 14 Feb 2013
...
@@ -26,7 +26,8 @@ Created on 14 Feb 2013
holds methods for generations of numbers from different distributions
holds methods for generations of numbers from different distributions
'''
'''
class
RandomNumberGenerator
(
object
):
class
RandomNumberGenerator
(
object
):
def
__init__
(
self
,
obj
,
distributionType
,
mean
=
0
,
stdev
=
0
,
min
=
0
,
max
=
0
,
alpha
=
0
,
beta
=
0
):
def
__init__
(
self
,
obj
,
distributionType
,
mean
=
0
,
stdev
=
0
,
min
=
0
,
max
=
0
,
alpha
=
0
,
beta
=
0
,
logmean
=
0
,
logsd
=
0
,
probability
=
0
,
shape
=
0
,
scale
=
0
,
location
=
0
):
self
.
distributionType
=
distributionType
self
.
distributionType
=
distributionType
self
.
mean
=
float
(
mean
or
0
)
self
.
mean
=
float
(
mean
or
0
)
self
.
stdev
=
float
(
stdev
or
0
)
self
.
stdev
=
float
(
stdev
or
0
)
...
@@ -34,8 +35,16 @@ class RandomNumberGenerator(object):
...
@@ -34,8 +35,16 @@ class RandomNumberGenerator(object):
self
.
max
=
float
(
max
or
0
)
self
.
max
=
float
(
max
or
0
)
self
.
alpha
=
float
(
alpha
or
0
)
self
.
alpha
=
float
(
alpha
or
0
)
self
.
beta
=
float
(
beta
or
0
)
self
.
beta
=
float
(
beta
or
0
)
self
.
logmean
=
float
(
logmean
or
0
)
self
.
logsd
=
float
(
logsd
or
0
)
self
.
probability
=
float
(
probability
or
0
)
self
.
shape
=
float
(
shape
or
0
)
self
.
scale
=
float
(
scale
or
0
)
self
.
location
=
float
(
location
or
0
)
self
.
obj
=
obj
self
.
obj
=
obj
def
generateNumber
(
self
):
def
generateNumber
(
self
):
from
Globals
import
G
from
Globals
import
G
if
(
self
.
distributionType
==
"Fixed"
):
#if the distribution is Fixed
if
(
self
.
distributionType
==
"Fixed"
):
#if the distribution is Fixed
...
...
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