Declaring a set of a set in Mosel

30 Views Asked by At

How can I declare a set of vehicles which is different for every carrier in Mosel? So basically a set of the set of carriers. I would also need the vehicles available in the decision variables. I tried doing it with a record but get various error messages. One error message says e.g. that the "Field 'Carrier' must be of a public type".

This is what I've tried:

declarations

    CUSTOMERS: range
    CARRIERS: set of string
    
    vehicle_data = public record
        Carrier: array(CARRIERS) of string
        Vehicles: range
        end-record
        
    CARRIER: vehicle_data
    A: array(range) of vehicle_data

    DEMAND: array (CUSTOMERS) of integer
    COSTS: array (CUSTOMERS, CARRIERS) of integer

    !decision variables:
    x_fik: dynamic array(CARRIERS, CARRIER.Vehicles, CUSTOMERS) of mpvar 
!if vehicle k of carrier f travels to customer i (1) or not (0)

    y_fk: dynamic array(CARRIERS, CARRIER.Vehicles) of mpvar 
!if vehicle k of carrier f is used (1) or not (0)

FILENAME = "Data_Model_3.dat"

end-declarations

initializations from FILENAME
    CUSTOMERS CARRIERS A DEMAND COSTS
end-initializations

Or is it possible to do something like that?

CUSTOMERS: range
CARRIERS: set of string
VEHICLES: array(CARRIERS) of set of integer 

Thank you!

0

There are 0 best solutions below