Skip to main content

I am building a multi depot multi vehicle transportation model. The model is running but gives 0 as optimal.

I am just about to introduce the vehicles set and this is where i am having trouble now. 

I want each depot to have two type of vehicles. This is the best way I can get to right now. 

 

I want a set of vehicle type and a set of depot. I want to tell the model that each depot in this example: 

depot 1 has 2 scooters, and 1 truck, and depot 2 has 3 scooters and 1 truck. 

Is there a better way to do this, and how to resolve the error. 

Attached is my model. 

 

 

I would not use the compound sets you are using, but I would use just a parameter

pNumberOfVehiclesAvailable(iDepot, iVehicle)

that gives you the number of vehicles of type iVehicle for depot iDepot

If you then later on want to introduce a constraint or variable for the i-th type of vehicle for a depot, you could do something like this

vIthVehicleOfTypeForDepot( iDepot, iVehicle, iVehicleCounter)

 

where iVehicleCounter is an index in a set sVehicleCounters that runs from 1..MaxNumberOfSameVehiclesAnywhere

You can then make sure that the variable has the following domain conditition, which will limit it to only the combinations that are valid

pVehicleDepotTypeCounterRelevant( iDepot, iVehicle, iVehicleCounter)

with definition

ord(iVehicleCounter) <= pNumberOfVehiclesAvailable(iDepot, iVehicle)

 

 


That is interesting approach. I can’t say I fully get it.

Can you tell me an example of the vVehicleAssignment(i,j,v) 

Would I need to rewrite it?


Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator