Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DALSim
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thibaut DEMARE
DALSim
Commits
b5a7e0f4
Commit
b5a7e0f4
authored
5 years ago
by
ThibautDemare
Browse files
Options
Downloads
Patches
Plain Diff
Remove the maxProcessEnteringGoodsCapacity. Use handling_time_from_[mode name] instead
parent
8671515b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
models/AwaitingStock.gaml
+2
-0
2 additions, 0 deletions
models/AwaitingStock.gaml
models/Building.gaml
+23
-10
23 additions, 10 deletions
models/Building.gaml
models/Terminals.gaml
+27
-0
27 additions, 0 deletions
models/Terminals.gaml
with
52 additions
and
10 deletions
models/AwaitingStock.gaml
+
2
−
0
View file @
b5a7e0f4
...
...
@@ -7,4 +7,6 @@ species AwaitingStock schedules:[] {
int stepOrderMade;
int position;
Building building;
date incomingDate;
string networkType;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
models/Building.gaml
+
23
−
10
View file @
b5a7e0f4
...
...
@@ -9,7 +9,6 @@ species Building {
float occupiedSurface;
float outflow <- 0.0;// This data is sended to Graphstream for the supplying network
bool outflow_updated <- false;
int maxProcessEnteringGoodsCapacity <- 5;
int timeShifting <- rnd(23);
list<Vehicle> leavingVehicles_road <- []; // Liste des véhicules au départ pour le mode routier
...
...
@@ -69,16 +68,16 @@ species Building {
}
}
action receiveCommodity(Commodity c, string n
etworkType
){
if(n
etworkType
= "road"){
action receiveCommodity(Commodity c, string n
t
){
if(n
t
= "road"){
nbRoadVehiclesLastSteps[length(nbRoadVehiclesLastSteps)-1] <- nbRoadVehiclesLastSteps[length(nbRoadVehiclesLastSteps)-1] + 1.0;
nbRoadQuantitiesLastSteps[length(nbRoadQuantitiesLastSteps)-1] <- nbRoadQuantitiesLastSteps[length(nbRoadQuantitiesLastSteps)-1] + c.volume;
}
if(n
etworkType
= "river"){
if(n
t
= "river"){
nbRiverVehiclesLastSteps[length(nbRiverVehiclesLastSteps)-1] <- nbRiverVehiclesLastSteps[length(nbRiverVehiclesLastSteps)-1] + 1.0;
nbRiverQuantitiesLastSteps[length(nbRiverQuantitiesLastSteps)-1] <- nbRiverQuantitiesLastSteps[length(nbRiverQuantitiesLastSteps)-1] + c.volume;
}
if(n
etworkType
= "maritime"){
if(n
t
= "maritime"){
nbMaritimeVehiclesLastSteps[length(nbMaritimeVehiclesLastSteps)-1] <- nbMaritimeVehiclesLastSteps[length(nbMaritimeVehiclesLastSteps)-1] + 1.0;
nbMaritimeQuantitiesLastSteps[length(nbMaritimeQuantitiesLastSteps)-1] <- nbMaritimeQuantitiesLastSteps[length(nbMaritimeQuantitiesLastSteps)-1] + c.volume;
}
...
...
@@ -88,6 +87,8 @@ species Building {
self.stock <- c.stock;
self.location <- myself.location;
self.building <- myself;
self.networkType <- nt;
self.incomingDate <- c.incomingDate;
}
entering_stocks <- entering_stocks + ast[0];
ask c {
...
...
@@ -99,10 +100,23 @@ species Building {
}
}
float getHandlingTimeFrom(string nt){
return handling_time_from_road;
}
reflex processEnteringGoods when: length(entering_stocks) > 0 {
int i <- 0;
loop while: i < maxProcessEnteringGoodsCapacity and length(entering_stocks) > 0 {
AwaitingStock entering_stock <- entering_stocks[0];
list<AwaitingStock> toBeIncluded <- [];
int k <- 0;
loop while: k < length(entering_stocks) {
float handling_time <- getHandlingTimeFrom(entering_stocks[k].networkType);
if(entering_stocks[k].incomingDate + handling_time°h >= current_date){
toBeIncluded <- toBeIncluded + entering_stocks[k];
}
k <- k + 1;
}
loop while:length(toBeIncluded) > 0 {
AwaitingStock entering_stock <- toBeIncluded[0];
int j <- 0;
bool notfound <- true;
loop while: j < length(stocks) and notfound {
...
...
@@ -122,8 +136,7 @@ species Building {
j <- j + 1;
}
i <- i + 1;
remove index:0 from: entering_stocks;
remove index:0 from: toBeIncluded;
if(notfound){
// this stock probably came after a changement of LP
...
...
This diff is collapsed.
Click to expand it.
models/Terminals.gaml
+
27
−
0
View file @
b5a7e0f4
...
...
@@ -33,6 +33,14 @@ species MaritimeTerminal parent:Terminal{
}
}
}
float getHandlingTimeFrom(string nt){
if(nt = "road"){
return handling_time_from_road;
}
// else : nt = "maritime"
return handling_time_from_maritime;
}
}
species RiverTerminal parent:Terminal{
...
...
@@ -54,6 +62,14 @@ species RiverTerminal parent:Terminal{
}
}
}
float getHandlingTimeFrom(string nt){
if(nt = "road"){
return handling_time_from_road;
}
// else : nt = "river"
return handling_time_from_river;
}
}
species MaritimeRiverTerminal parent:Terminal {
...
...
@@ -92,4 +108,15 @@ species MaritimeRiverTerminal parent:Terminal {
}
}
}
float getHandlingTimeFrom(string nt){
if(nt = "road"){
return handling_time_from_road;
}
if(nt = "maritime"){
return handling_time_from_maritime;
}
// else : nt = "river"
return handling_time_from_river;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment