[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-glpk] Re: trivial question re MathProg
From: |
Andrew Makhorin |
Subject: |
[Help-glpk] Re: trivial question re MathProg |
Date: |
Sat, 05 Jul 2003 22:42:42 +0400 |
>I have written the following code:
>
>set CITIES;
>param LST >0 integer;
>set TIMES:=1..last;
>set TRIPS within {c1 in cities, t1 in times, c2 in cities, t2 in times};
>
>So TRIPS is made of :
>departure city
>departure time
>arrival city
>arrival time
>
>Now I want to define a new set - SHIFTS - with elements belonging to TRIPS,
>and the condition that the elements will be so aligned that the departure
>time of
>trip[I] will follow the arrival time of trip[I-1].
In order to construct a subset of the Cartesian product you can use
predicates, i.e. something like this:
set SHIFTS := {(c1,t1,c2,t2) in TRIPS: ...predicate...};
where ...predicate... is a logical expression built in terms of dummy
indices c1, t1, c2, t2; only quadruples which satisfy to this condition
will be included in the set SHIFTS.
For details please consult the documentation.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Help-glpk] Re: trivial question re MathProg,
Andrew Makhorin <=