Originally posted by: SystemAdmin
[UDOPS said:]
Here are things I tried. I don't know if they will paste into constraints, but I think you get the idea.
tuple flight {
key string flightID;
{int} nodes;
{int} holdingNodes;
int destination;
int origin;
string status;
string class;
int OBT;
int ETA;
}
{flight} Flights = {
<", {6,1,2,3}, {3}, 3,6, "dept", "s", 1,0>,
<", {6,7,2,3}, {3}, 3,6, "dept", "h", 1,0>,
<", {35, 34, 33, 32, 31}, {, 31, 35, "arri", "h", 0, 700>,
<", {35, 34, 33, 32, 31,26}, {35}, 26, 35, "arri", "s", 0, 800>
};
{flight} Flightdept = {f | f in Flights: f.status=="dept"};
int Deptcount = card(Flightdept);
int Deptcountalt = card({f | f in Flights: f.status=="dept"}); //alternate form
//more ideas
tuple shortlist {
key string flightID;
int destination;
}
{35}shortlist} Deptlist = {<f.flightID, f.destination> | f in Flights: f.status=="dept"};
execute{
for (var f in Flightdept) {
writeln(f.flightID+", "+f.status)
}
writeln(Deptcount)
writeln(Deptcountalt)
writeln(Deptlist)
}
#DecisionOptimization#OPLusingCPLEXOptimizer