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
0fb16446
Commit
0fb16446
authored
Sep 01, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
methods moved after __init__
Conflicts: dream/simulation/Machine.py
parent
f90d54a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
32 deletions
+34
-32
dream/simulation/Machine.py
dream/simulation/Machine.py
+34
-32
No files found.
dream/simulation/Machine.py
View file @
0fb16446
...
...
@@ -45,38 +45,6 @@ from RandomNumberGenerator import RandomNumberGenerator
# ===========================================================================
class
Machine
(
CoreObject
):
family
=
'Server'
@
staticmethod
def
getProcessingTime
(
processingTime
):
'''returns the processingTime dictionary updated'''
if
not
processingTime
:
processingTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
1
,
}
if
processingTime
[
'distributionType'
]
==
'Normal'
and
\
processingTime
.
get
(
'max'
,
None
)
is
None
:
processingTime
[
'max'
]
=
float
(
processingTime
[
'mean'
])
+
5
*
float
(
processingTime
[
'stdev'
])
return
processingTime
@
staticmethod
def
getSetupTime
(
setupTime
):
'''returns the setupTime dictionary updated'''
if
not
setupTime
:
setupTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
1
,
}
if
setupTime
[
'distributionType'
]
==
'Normal'
and
\
setupTime
.
get
(
'max'
,
None
)
is
None
:
setupTime
[
'max'
]
=
float
(
setupTime
[
'mean'
])
+
5
*
float
(
setupTime
[
'stdev'
])
return
setupTime
@
staticmethod
def
getLoadTime
(
loadTime
):
'''returns the loadTime dictionary updated'''
if
not
loadTime
:
loadTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
1
,
}
if
loadTime
[
'distributionType'
]
==
'Normal'
and
\
loadTime
.
get
(
'max'
,
None
)
is
None
:
loadTime
[
'max'
]
=
float
(
loadTime
[
'mean'
])
+
5
*
float
(
loadTime
[
'stdev'
])
return
loadTime
# =======================================================================
# initialise the id the capacity, of the resource and the distribution
...
...
@@ -208,6 +176,40 @@ class Machine(CoreObject):
self
.
preemptQueue
=
self
.
env
.
event
()
# signal used for informing objectInterruption objects that the current entity processed has finished processnig
self
.
endedLastProcessing
=
self
.
env
.
event
()
@
staticmethod
def
getProcessingTime
(
processingTime
):
'''returns the processingTime dictionary updated'''
if
not
processingTime
:
processingTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
1
,
}
if
processingTime
[
'distributionType'
]
==
'Normal'
and
\
processingTime
.
get
(
'max'
,
None
)
is
None
:
processingTime
[
'max'
]
=
float
(
processingTime
[
'mean'
])
+
5
*
float
(
processingTime
[
'stdev'
])
return
processingTime
@
staticmethod
def
getSetupTime
(
setupTime
):
'''returns the setupTime dictionary updated'''
if
not
setupTime
:
setupTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
1
,
}
if
setupTime
[
'distributionType'
]
==
'Normal'
and
\
setupTime
.
get
(
'max'
,
None
)
is
None
:
setupTime
[
'max'
]
=
float
(
setupTime
[
'mean'
])
+
5
*
float
(
setupTime
[
'stdev'
])
return
setupTime
@
staticmethod
def
getLoadTime
(
loadTime
):
'''returns the loadTime dictionary updated'''
if
not
loadTime
:
loadTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
1
,
}
if
loadTime
[
'distributionType'
]
==
'Normal'
and
\
loadTime
.
get
(
'max'
,
None
)
is
None
:
loadTime
[
'max'
]
=
float
(
loadTime
[
'mean'
])
+
5
*
float
(
loadTime
[
'stdev'
])
return
loadTime
#===========================================================================
# create an operatorPool if needed
...
...
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