Commit 25f0107e authored by ThibautDemare's avatar ThibautDemare

Put the current cycle in the filename when save FC agents so we can backup previous one

parent 86c1963e
......@@ -34,16 +34,16 @@ global {
reflex storeAgent when: saveAgents {
if(savedAgents > 0 and cycle mod savedAgents){
write "================ START SAVE - " + cycle;
save "surface; localAverageCosts; localWarehousingCosts; averageCostsOfNeighbors; localVolumeNormalizedAverageCosts; localAverageNbStockShortagesLastSteps; region; department; lsp.costsPathStrategy; lsp.threshold; lsp.averageCosts; lsp.cumulateCosts; lsp.adoptedSelectingWarehouseStrategy; lsp.provider.port; lsp.nbCustomers; lsp.region; lsp.department" to: "/Agents/FinalConsignee.csv" type: "csv" rewrite:true;
save "surface; localAverageCosts; localWarehousingCosts; averageCostsOfNeighbors; localVolumeNormalizedAverageCosts; localAverageNbStockShortagesLastSteps; region; department; lsp.costsPathStrategy; lsp.threshold; lsp.averageCosts; lsp.cumulateCosts; lsp.adoptedSelectingWarehouseStrategy; lsp.provider.port; lsp.nbCustomers; lsp.region; lsp.department" to: "/Agents/FinalConsignee_"+cycle+".csv" type: "csv" rewrite:true;
ask FinalConsignee {
save [surface, localAverageCosts, localWarehousingCosts, averageCostsOfNeighbors, localVolumeNormalizedAverageCosts, localAverageNbStockShortagesLastSteps, region, department, logisticsServiceProvider.costsPathStrategy, logisticsServiceProvider.threshold, logisticsServiceProvider.averageCosts, logisticsServiceProvider.cumulateCosts, logisticsServiceProvider.adoptedSelectingWarehouseStrategy, logisticsServiceProvider.provider.port, length(logisticsServiceProvider.customers), logisticsServiceProvider.region, logisticsServiceProvider.department] to: "/Agents/FinalConsignee.csv" type: "csv" rewrite:false;
save [surface, localAverageCosts, localWarehousingCosts, averageCostsOfNeighbors, localVolumeNormalizedAverageCosts, localAverageNbStockShortagesLastSteps, region, department, logisticsServiceProvider.costsPathStrategy, logisticsServiceProvider.threshold, logisticsServiceProvider.averageCosts, logisticsServiceProvider.cumulateCosts, logisticsServiceProvider.adoptedSelectingWarehouseStrategy, logisticsServiceProvider.provider.port, length(logisticsServiceProvider.customers), logisticsServiceProvider.region, logisticsServiceProvider.department] to: "/Agents/FinalConsignee_"+cycle+".csv" type: "csv" rewrite:false;
}
write "================ END SAVE AGENTS - " + cycle;
}
}
action backupSim {
if(cycle mod 100 = 0 ){
if(cycle mod 500 = 0 ){
write "================ START SAVE SIMULATION - " + cycle;
write "Save of simulation : " + save_simulation("/Backup/backup_simu_"+cycle+".gsim");
write "================ END SAVE SIMULATION - " + cycle;
......
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