Skip to content
Snippets Groups Projects
Commit e44be93c authored by ThibautDemare's avatar ThibautDemare
Browse files

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
Branches
No related merge requests found
...@@ -40,13 +40,13 @@ global { ...@@ -40,13 +40,13 @@ global {
loop while: i < length(savedAgents) {// loop while: i < length(savedAgents) {//
if(cycle = savedAgents[i]){ if(cycle = savedAgents[i]){
write "================ START SAVE - " + cycle; 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{ 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 { 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; write "================ END SAVE AGENTS - " + cycle;
} }
......
...@@ -10,6 +10,10 @@ species FinalConsignee { // Used to be called FinalDestinationManager with assoc ...@@ -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. 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; Building building;
// Data from the Shapefile used for analysis purpose
int department;
int region;
// Relative to contract with LSP // Relative to contract with LSP
LogisticsServiceProvider logisticsServiceProvider <- nil; LogisticsServiceProvider logisticsServiceProvider <- nil;
int timeShifting <- rnd(23); int timeShifting <- rnd(23);
......
...@@ -20,6 +20,10 @@ species LogisticsServiceProvider { ...@@ -20,6 +20,10 @@ species LogisticsServiceProvider {
float probaAnt <- 0.5; float probaAnt <- 0.5;
string costsPathStrategy; string costsPathStrategy;
// Data from the Shapefile used for analysis purpose
int department;
int region;
init { init {
if(isLocalSelectingWarehouseStrategies){ if(isLocalSelectingWarehouseStrategies){
adoptedSelectingWarehouseStrategy <- one_of(possibleSelectingWarehouseStrategies); adoptedSelectingWarehouseStrategy <- one_of(possibleSelectingWarehouseStrategies);
......
...@@ -190,7 +190,7 @@ global { ...@@ -190,7 +190,7 @@ global {
/**/ /**/
// Logistic Service providers // 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 * 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 { ...@@ -208,7 +208,7 @@ global {
/**/ /**/
// Final destinations // 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 * 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. * It is mainly used for tests to avoid CPU overload.
......
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