Newer
Older
Thibaut Démare
committed
model Parameters
import "FinalDestinationManager.gaml"
import "Warehouse.gaml"
import "LogisticsServiceProvider.gaml"
Thibaut Démare
committed
global {
float step <- 60 #mn;//60 minutes per step
date starting_date <- date([2018,6,5,11,0,0]);// 5 Juin 2018 11h00
ThibautDemare
committed
// Selecting Warehouse Strategies
bool isLocalSelectingWarehouseStrategies <- true;
int globalSelectingWarehouseStrategies <- 1;
list<int> possibleSelectingWarehouseStrategies <- [1, 2, 3, 4]; //[1];//[1, 4];// [1, 2, 3, 4] // 1 : biased random selection - 2 : accessibility - 3 : closest/largest - 4 : pure random selection
ThibautDemare
committed
// Cost path strategies
bool isLocalCostPathStrategy <- true;
list<string> possibleCostPathStrategies <- ['financial_costs','travel_time'];
string globalCostPathStrategy <- 'financial_costs';
// Parameters relative to the threshold used by LSPs to decide when to restock
bool localThreshold <- true;
float minlocalThreshold <- 0.05;
float maxlocalThreshold <- 0.2;
// Parameters relative to the ability of the final consignee to switch of LSP
bool isLocalLSPSwitcStrat <- false;
list<int> possibleLSPSwitcStrats <- [1, 2, 3]; // 1 : NbStockShortages - 2 : TimeToBeDelivered - 3 : Costs
ThibautDemare
committed
int globalLSPSwitchStrat <- 3;
bool allowLSPSwitch <- true;
// Attractiveness parameters
float LHAttractiveness;
float AntAttractiveness;
Thibaut Démare
committed
/*
* Allow or disallow the execution of scenarios
*/
bool allowScenarioAttractiveness <- false;
bool allowScenarioBlockRoads <- false;
ThibautDemare
committed
bool allowScenarionCanalSeineNord <- false;
Thibaut Démare
committed
Thibaut Démare
committed
/*
* Some variables and functions to call some reflex
Thibaut Démare
committed
*/
// The minimal number of days a final destination manager must wait before he can decide if he wants to change of logistic provider
ThibautDemare
committed
int minimalNumberOfHoursOfContract <- 336; // number of steps for two weeks
// The number of steps considered to compute the logistic provider efficiency
ThibautDemare
committed
int nbStepsConsideredForLPEfficiency <- 96; // 4 days
// The numbers of steps between each calls to the reflex "decreasingStocks"
int nbStepsbetweenDS <- 24;
// The numbers of steps between each calls to the reflex "testRestockNeeded"
int nbStepsbetweenTRN <- 24;
// The numbers of steps between each calls to the reflex "processOrders" by Warehouse agents
int nbStepsBetweenWPO <- 6;
// The numbers of steps between each calls to the reflex "processOrders" by Provider agents
int nbStepsBetweenPPO <- 6;
// The numbers of steps between each calls to the reflex "processEnteringGoods" by Warehouse and Building agents
int nbStepsBetweenPEG <- 24;
int sizeOfStockLocalWarehouse <- 2;
int sizeOfStockLargeWarehouse <- 3;
Thibaut Démare
committed
/**
* Each final destination manager is associated to a rate of decreasing of his stocks.
* This rate is computed thanks to a linear function according to the previously computed Huff value associated to the building.
* The more the Huff value is high, the more the stocks decrease quickly, the more the rate is down
Thibaut Démare
committed
*/
float valForMaxHuff <- 2.0;
Thibaut Démare
committed
action init_decreasingRateOfStocks {
list<FinalDestinationManager> dests <- FinalDestinationManager sort_by each.huffValue;
int i <- 0;
int ld <- length(dests);
loop while: i < ld {
FinalDestinationManager fdm <- dests[i];
fdm.decreasingRateOfStocks <- round(((valForMaxHuff-valForMinHuff) / (length(dests)-1)) * (i) + valForMinHuff);
Thibaut Démare
committed
i <- i + 1;
}
}
Thibaut Démare
committed
/**
* We associate a cost to each warehouse according to its surface.
Thibaut Démare
committed
*/
float valForMinCost <- 1.0;
float valForMaxCost <- 100.0;
action init_cost {
list<Warehouse> lw <- Warehouse sort_by each.totalSurface;
int i <- 0;
int ld <- length(lw);
loop while: i < ld {
Warehouse w <- lw[i];
w.cost <- rnd(valForMaxCost - valForMinCost) + valForMinCost;// round(((valForMaxCost-valForMinCost) / (length(lw)-1)) * (i) + valForMinCost);
i <- i + 1;
}
}