this repo has no description
1%
2% Main authors:
3% Guido Tack <tack@gecode.org>
4% Mikael lagerkvist <lagerkvist@gecode.org>
5%
6% Copyright:
7% Guido Tack, 2007
8% Mikael Lagerkvist, 2009
9%
10% Last modified:
11% $Date: 2011-03-08 19:54:48 +1100 (Tue, 08 Mar 2011) $ by $Author: tack $
12% $Revision: 11787 $
13%
14% This file is part of Gecode, the generic constraint
15% development environment:
16% http://www.gecode.org
17%
18% Permission is hereby granted, free of charge, to any person obtaining
19% a copy of this software and associated documentation files (the
20% "Software"), to deal in the Software without restriction, including
21% without limitation the rights to use, copy, modify, merge, publish,
22% distribute, sublicense, and/or sell copies of the Software, and to
23% permit persons to whom the Software is furnished to do so, subject to
24% the following conditions:
25%
26% The above copyright notice and this permission notice shall be
27% included in all copies or substantial portions of the Software.
28%
29% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
30% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
31% MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
32% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
33% LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
34% OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
35% WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36%
37%
38
39predicate fzn_cumulative(array[int] of var int: s,
40 array[int] of var int: d,
41 array[int] of var int: r, var int: b) =
42 assert(index_set(s) == index_set(d) /\ index_set(s) == index_set(r),
43 "cumulative: the 3 array arguments must have identical index sets",
44 assert(lb_array(d) >= 0 /\ lb_array(r) >= 0,
45 "cumulative: durations and resource usages must be non-negative",
46 cumulatives(s, d, r, b)
47 )
48 );
49
50% Specialized cumulatives propagator is only for fixed bounds
51predicate cumulatives(array[int] of var int: s,
52 array[int] of var int: d,
53 array[int] of var int: r, var int: b);