Commit e44be93c authored by ThibautDemare's avatar ThibautDemare

Add the region and department origin to these two species in order to use them...

Add the region and department origin to these two species in order to use them for classification purpose
parent b979a533
......@@ -40,13 +40,13 @@ global {
loop while: i < length(savedAgents) {//
if(cycle = savedAgents[i]){
write "================ START SAVE - " + cycle;
save "costsPathStrategy; threshold; averageCosts; cumulateCosts; adoptedSelectingWarehouseStrategy; provider.port; length(customers)" to: "LogisticsServiceProvider.csv" type: "csv" rewrite:true;
save "costsPathStrategy; threshold; averageCosts; cumulateCosts; adoptedSelectingWarehouseStrategy; provider.port; nbCustomers; region; department" to: "LogisticsServiceProvider.csv" type: "csv" rewrite:true;
ask LogisticsServiceProvider{
save [costsPathStrategy, threshold, averageCosts, cumulateCosts, adoptedSelectingWarehouseStrategy, provider.port, length(customers)] to: "LogisticsServiceProvider.csv" type: "csv" rewrite:false;
save [costsPathStrategy, threshold, averageCosts, cumulateCosts, adoptedSelectingWarehouseStrategy, provider.port, length(customers), region, department] to: "LogisticsServiceProvider.csv" type: "csv" rewrite:false;
}
save "surface; localAverageCosts; localWarehousingCosts; averageCostsOfNeighbors; localVolumeNormalizedAverageCosts; localAverageNbStockShortagesLastSteps" to: "FinalConsignee.csv" type: "csv" rewrite:true;
save "surface; localAverageCosts; localWarehousingCosts; averageCostsOfNeighbors; localVolumeNormalizedAverageCosts; localAverageNbStockShortagesLastSteps; region; department" to: "FinalConsignee.csv" type: "csv" rewrite:true;
ask FinalConsignee {
save [surface, localAverageCosts, localWarehousingCosts, averageCostsOfNeighbors, localVolumeNormalizedAverageCosts, localAverageNbStockShortagesLastSteps] to: "FinalConsignee.csv" type: "csv" rewrite:false;
save [surface, localAverageCosts, localWarehousingCosts, averageCostsOfNeighbors, localVolumeNormalizedAverageCosts, localAverageNbStockShortagesLastSteps, region, department] to: "FinalConsignee.csv" type: "csv" rewrite:false;
}
write "================ END SAVE AGENTS - " + cycle;
}
......
......@@ -10,6 +10,10 @@ species FinalConsignee { // Used to be called FinalDestinationManager with assoc
float huffValue;// number of customer according to huff model => this value cant be used like this because the Huff model does not take care of time.
Building building;
// Data from the Shapefile used for analysis purpose
int department;
int region;
// Relative to contract with LSP
LogisticsServiceProvider logisticsServiceProvider <- nil;
int timeShifting <- rnd(23);
......
......@@ -20,6 +20,10 @@ species LogisticsServiceProvider {
float probaAnt <- 0.5;
string costsPathStrategy;
// Data from the Shapefile used for analysis purpose
int department;
int region;
init {
if(isLocalSelectingWarehouseStrategies){
adoptedSelectingWarehouseStrategy <- one_of(possibleSelectingWarehouseStrategies);
......
......@@ -190,7 +190,7 @@ global {
/**/
// Logistic Service providers
create LogisticsServiceProvider from: logistic_provider_shapefile;
create LogisticsServiceProvider from: logistic_provider_shapefile with: [region::int(read("region")), department::float(read("department"))];
/*
* The following code can be commented or not, depending if the user want to execute the simulation with every LSP
......@@ -208,7 +208,7 @@ global {
/**/
// Final destinations
create FinalConsignee from: destination_shapefile with: [huffValue::float(read("huff")), surface::float(read("surface"))];
create FinalConsignee from: destination_shapefile with: [huffValue::float(read("huff")), surface::float(read("surface")), region::int(read("region")), department::float(read("department"))];
/*
* The following code can be commented or not, depending if the user want to execute the simulation with every FDM
* It is mainly used for tests to avoid CPU overload.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment