Generated on Tue Feb 11 2025 17:33:26 for Gecode by doxygen 1.12.0
cumulatives.hh
Go to the documentation of this file.
1/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2/*
3 * Main authors:
4 * Mikael Lagerkvist <lagerkvist@gecode.org>
5 *
6 * Copyright:
7 * Mikael Lagerkvist, 2005
8 *
9 * This file is part of Gecode, the generic constraint
10 * development environment:
11 * http://www.gecode.org
12 *
13 * Permission is hereby granted, free of charge, to any person obtaining
14 * a copy of this software and associated documentation files (the
15 * "Software"), to deal in the Software without restriction, including
16 * without limitation the rights to use, copy, modify, merge, publish,
17 * distribute, sublicense, and/or sell copies of the Software, and to
18 * permit persons to whom the Software is furnished to do so, subject to
19 * the following conditions:
20 *
21 * The above copyright notice and this permission notice shall be
22 * included in all copies or substantial portions of the Software.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 *
32 */
33
34#ifndef __GECODE_INT_CUMULATIVES_HH__
35#define __GECODE_INT_CUMULATIVES_HH__
36
37#include <gecode/int.hh>
38
39namespace Gecode { namespace Int { namespace Cumulatives {
40
85 template<class ViewM, class ViewP, class ViewU, class View>
86 class Val : public Propagator {
87 protected:
94 const bool at_most;
95
97 Val(Home home, const ViewArray<ViewM>&, const ViewArray<View>&,
98 const ViewArray<ViewP>&, const ViewArray<View>&,
99 const ViewArray<ViewU>&, const SharedArray<int>&, bool);
100
101 ExecStatus prune(Space& home, int low, int up, int r,
102 int ntask, int su,
103 int* contribution,
104 int* prune_tasks, int& prune_tasks_size);
105 public:
107 virtual Actor* copy(Space& home);
109 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
111 virtual void reschedule(Space& home);
113 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
115 static ExecStatus post(Home home, const ViewArray<ViewM>&,
116 const ViewArray<View>&, const ViewArray<ViewP>&,
117 const ViewArray<View>&, const ViewArray<ViewU>&,
118 const SharedArray<int>&, bool);
120 virtual size_t dispose(Space& home);
121 };
122
123
124}}}
125
127
128#endif
129
130// STATISTICS: int-prop
131
Base-class for both propagators and branchers.
Definition core.hpp:628
Home class for posting propagators
Definition core.hpp:856
Propagator for the cumulatives constraint
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition val.hpp:271
static ExecStatus post(Home home, const ViewArray< ViewM > &, const ViewArray< View > &, const ViewArray< ViewP > &, const ViewArray< View > &, const ViewArray< ViewU > &, const SharedArray< int > &, bool)
Post propagator.
Definition val.hpp:69
ExecStatus prune(Space &home, int low, int up, int r, int ntask, int su, int *contribution, int *prune_tasks, int &prune_tasks_size)
Definition val.hpp:168
virtual Actor * copy(Space &home)
Create copy during cloning.
Definition val.hpp:123
virtual void reschedule(Space &home)
Schedule function.
Definition val.hpp:113
Val(Space &home, Val< ViewM, ViewP, ViewU, View > &p)
Definition val.hpp:79
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low quadratic)
Definition val.hpp:107
virtual size_t dispose(Space &home)
Dispose propagator.
Definition val.hpp:91
Propagation cost.
Definition core.hpp:486
Base-class for propagators.
Definition core.hpp:1064
ModEventDelta med
A set of modification events (used during propagation)
Definition core.hpp:1075
Shared array with arbitrary number of elements.
Computation spaces.
Definition core.hpp:1742
View arrays.
Definition array.hpp:253
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition set.hh:767
ExecStatus
Definition core.hpp:472