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
04cb55a6
Commit
04cb55a6
authored
Nov 09, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MilkTank to give for transport only when the volume is gathered
parent
bf63da2a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
14 deletions
+20
-14
dream/simulation/Examples/MilkPlant01.py
dream/simulation/Examples/MilkPlant01.py
+4
-4
dream/simulation/applications/MilkPlant/MilkTank.py
dream/simulation/applications/MilkPlant/MilkTank.py
+16
-10
No files found.
dream/simulation/Examples/MilkPlant01.py
View file @
04cb55a6
...
...
@@ -14,15 +14,15 @@ Tr3=MilkTransport('Tr3','Tr3')
E
=
Exit
(
'E'
,
'Exit'
)
route1
=
[{
"stationIdsList"
:
[
"T1"
]},
{
"stationIdsList"
:
[
"Tr1"
],
"processingTime"
:{
'Fixed'
:{
'mean'
:
1
}}},
{
"stationIdsList"
:
[
"Tr1"
],
"processingTime"
:{
'Fixed'
:{
'mean'
:
0.1734
1
}}},
{
"stationIdsList"
:
[
"T2"
]},
{
"stationIdsList"
:
[
"Tr2"
],
"processingTime"
:{
'Fixed'
:{
'mean'
:
1
}}},
{
"stationIdsList"
:
[
"Tr2"
],
"processingTime"
:{
'Fixed'
:{
'mean'
:
1
}}
,
'volume'
:
1000
},
{
"stationIdsList"
:
[
"E"
]}]
route2
=
[{
"stationIdsList"
:
[
"T3"
]},
{
"stationIdsList"
:
[
"Tr3"
],
"processingTime"
:{
'Fixed'
:{
'mean'
:
1
}}},
{
"stationIdsList"
:
[
"Tr3"
],
"processingTime"
:{
'Fixed'
:{
'mean'
:
1
.11111
}}},
{
"stationIdsList"
:
[
"T2"
]},
{
"stationIdsList"
:
[
"Tr2"
],
"processingTime"
:{
'Fixed'
:{
'mean'
:
1
}}},
{
"stationIdsList"
:
[
"Tr2"
],
"processingTime"
:{
'Fixed'
:{
'mean'
:
1
}}
,
'volume'
:
1000
},
{
"stationIdsList"
:
[
"E"
]}]
MPList
=
[]
...
...
dream/simulation/applications/MilkPlant/MilkTank.py
View file @
04cb55a6
...
...
@@ -34,21 +34,27 @@ class MilkTank(QueueJobShop):
QueueJobShop
.
__init__
(
self
,
id
,
name
,
capacity
)
def
haveToDispose
(
self
,
callerObject
=
None
):
if
len
(
self
.
getActiveObjectQueue
()):
requestedVolume
=
self
.
getActiveObjectQueue
()[
0
].
remainingRoute
[
0
].
get
(
'volume'
,
-
1
)
totalLiters
=
self
.
getTotalLiters
()
if
totalLiters
<
requestedVolume
:
return
False
return
QueueJobShop
.
haveToDispose
(
self
,
callerObject
)
def
getFat
(
self
):
return
self
.
getTotalFat
()
/
float
(
self
.
getTotalLiters
())
def
getTotalLiters
(
self
):
totalLiters
=
0
totalFat
=
0
for
pack
in
self
.
getActiveObjectQueue
():
totalLiters
+=
pack
.
liters
totalFat
+=
pack
.
fat
return
totalFat
/
float
(
totalLiters
)
totalLiters
+=
pack
.
liters
return
totalLiters
def
getTotalFat
(
self
):
totalFat
=
0
for
pack
in
self
.
getActiveObjectQueue
():
totalFat
+=
pack
.
fat
*
pack
.
liters
return
totalFat
\ No newline at end of file
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