3 multiple objectives function

6 views
Skip to first unread message

Corazon

unread,
Dec 1, 2022, 6:01:43 AM12/1/22
to AMPL Modeling Language
Dear Robert,

I hope you're doing well. I have a question regarding solving multiple objective function. In my model, I have 3 objectives that I've compiled in 1 objective function, which is "Total Cost". But after running it using Gurobi, it turns out that the result only considers 2 objective functions and exclude my fix cost function. 
result 1.PNG


Do you know why does it happen? Please kindly find my attached file along with this message. Thank you.

Regards,
CCVRP.mod
tes.dat

AMPL Google Group

unread,
Dec 1, 2022, 2:38:31 PM12/1/22
to AMPL Modeling Language
You can't use the name of an objective (like variable_cost) in the AMPL expression for another objective. Instead, use "defined variables" to identify the different kinds of cost, and add them up to represent the total cost objective:

var variable_cost = sum {i in customers, j in customers: i<>j} 
   (teta_1 *(arrival[j] - arrival[i]) + teta_2 * service[i]);
var energy_cost = sum {i in vertices, j in vertices: i<>j} 
   route[i,j] * fuel_cost * (distance[i,j] * (rate_0 + delta * loadVeh[i,j]));
var fixed_cost = sum {j in customers} fix_cost * route[0,j];

minimize total_cost: variable_cost + energy_cost + fixed_cost;


--
Robert Fourer
am...@googlegroups.com
{#HS:2084414520-113051#}
Regards, --
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ampl/acf80892-6649-4274-9915-9e6466a1398bn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages