Generated on Tue Jun 4 2019 05:23:33 for Gecode by doxygen 1.8.15
core.cpp
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Christian Schulte <schulte@gecode.org>
5  *
6  * Copyright:
7  * Christian Schulte, 2002
8  *
9  * Last modified:
10  * $Date: 2013-10-30 16:01:30 +0100 (Wed, 30 Oct 2013) $ by $Author: schulte $
11  * $Revision: 14038 $
12  *
13  * This file is part of Gecode, the generic constraint
14  * development environment:
15  * http://www.gecode.org
16  *
17  * Permission is hereby granted, free of charge, to any person obtaining
18  * a copy of this software and associated documentation files (the
19  * "Software"), to deal in the Software without restriction, including
20  * without limitation the rights to use, copy, modify, merge, publish,
21  * distribute, sublicense, and/or sell copies of the Software, and to
22  * permit persons to whom the Software is furnished to do so, subject to
23  * the following conditions:
24  *
25  * The above copyright notice and this permission notice shall be
26  * included in all copies or substantial portions of the Software.
27  *
28  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35  *
36  */
37 
38 #include <gecode/kernel.hh>
39 
40 namespace Gecode {
41 
42  /*
43  * Variable type disposer
44  *
45  */
46  void
48 
50 
51 
52 
53  /*
54  * Actor
55  *
56  */
57  Actor* Actor::sentinel;
58 
59 #ifdef __GNUC__
60  Actor::~Actor(void) {}
62 #endif
63 
64 
65 
66  /*
67  * Propagator
68  *
69  */
72  assert(false);
73  return ES_FAILED;
74  }
75 
76 
77  /*
78  * No-goods
79  *
80  */
81  void
83  }
84 
85 
86  /*
87  * Brancher
88  *
89  */
90  NGL*
91  Brancher::ngl(Space&, const Choice&, unsigned int) const {
92  return NULL;
93  }
94 
95  void
96  Brancher::print(const Space&, const Choice&, unsigned int,
97  std::ostream&) const {
98  }
99 
100 
101  /*
102  * Space: Misc
103  *
104  */
105  StatusStatistics Space::unused_status;
106  CloneStatistics Space::unused_clone;
107  CommitStatistics Space::unused_commit;
108 
109 #ifdef GECODE_HAS_VAR_DISPOSE
111 #endif
112 
114  : sm(new SharedMemory), mm(sm), _wmp_afc(0U) {
115 #ifdef GECODE_HAS_VAR_DISPOSE
116  for (int i=0; i<AllVarConf::idx_d; i++)
117  _vars_d[i] = NULL;
118 #endif
119  // Initialize propagator and brancher links
120  pl.init();
121  bl.init();
122  b_status = b_commit = Brancher::cast(&bl);
123  // Initialize array for forced deletion to be empty
124  d_fst = d_cur = d_lst = NULL;
125  // Initialize space as stable but not failed
126  pc.p.active = &pc.p.queue[0]-1;
127  // Initialize propagator queues
128  for (int i=0; i<=PropCost::AC_MAX; i++)
129  pc.p.queue[i].init();
130  pc.p.branch_id = reserved_branch_id+1;
131  pc.p.n_sub = 0;
132  }
133 
134  void
135  Space::notice(Actor& a, ActorProperty p, bool duplicate) {
136  if (p & AP_DISPOSE) {
137  if (duplicate && (d_fst != NULL)) {
138  for (Actor** f = d_fst; f < d_cur; f++)
139  if (&a == *f)
140  return;
141  }
142  if (d_cur == d_lst) {
143  // Resize
144  if (d_fst == NULL) {
145  // Create new array
146  d_fst = alloc<Actor*>(4);
147  d_cur = d_fst;
148  d_lst = d_fst+4;
149  } else {
150  // Resize existing array
151  unsigned int n = static_cast<unsigned int>(d_lst - d_fst);
152  assert(n != 0);
153  d_fst = realloc<Actor*>(d_fst,n,2*n);
154  d_cur = d_fst+n;
155  d_lst = d_fst+2*n;
156  }
157  }
158  *(d_cur++) = &a;
159  } else if (p & AP_WEAKLY) {
160  if (wmp() == 0)
161  wmp(2);
162  else
163  wmp(wmp()+1);
164  }
165  }
166 
167  void
168  Space::ignore(Actor& a, ActorProperty p, bool duplicate) {
169  if (p & AP_DISPOSE) {
170  // Check wether array has already been discarded as space
171  // deletion is already in progress
172  if (d_fst == NULL)
173  return;
174  Actor** f = d_fst;
175  if (duplicate) {
176  while (f < d_cur)
177  if (&a == *f)
178  break;
179  else
180  f++;
181  if (f == d_cur)
182  return;
183  } else {
184  while (&a != *f)
185  f++;
186  }
187  *f = *(--d_cur);
188  } else if (p & AP_WEAKLY) {
189  assert(wmp() > 1U);
190  wmp(wmp()-1);
191  }
192  }
193 
194  unsigned int
195  Space::propagators(void) const {
196  unsigned int n = 0;
197  for (Propagators p(*this); p(); ++p)
198  n++;
199  return n;
200  }
201 
202  unsigned int
203  Space::branchers(void) const {
204  unsigned int n = 0;
205  for (Branchers b(*this); b(); ++b)
206  n++;
207  return n;
208  }
209 
210  void
211  Space::flush(void) {
212  // Flush malloc cache
213  sm->flush();
214  }
215 
217  // Mark space as failed
218  fail();
219  // Delete actors that must be deleted
220  {
221  Actor** a = d_fst;
222  Actor** e = d_cur;
223  // So that d_unforce knows that deletion is in progress
224  d_fst = NULL;
225  while (a < e) {
226  (void) (*a)->dispose(*this);
227  a++;
228  }
229  }
230 #ifdef GECODE_HAS_VAR_DISPOSE
231  // Delete variables that were registered for disposal
232  for (int i=AllVarConf::idx_d; i--;)
233  if (_vars_d[i] != NULL)
234  vd[i]->dispose(*this, _vars_d[i]);
235 #endif
236  // Release memory from memory manager
237  mm.release(sm);
238  // Release shared memory
239  if (sm->release())
240  delete sm;
241  }
242 
243 
244 
245  /*
246  * Space: propagation
247  *
248  */
249 
253  // Check whether space is failed
254  if (failed()) {
255  s = SS_FAILED; goto exit;
256  }
257  assert(pc.p.active <= &pc.p.queue[PropCost::AC_MAX+1]);
258  // Check whether space is stable but not failed
259  if (pc.p.active >= &pc.p.queue[0]) {
260  Propagator* p;
261  ModEventDelta med_o;
262  goto unstable;
263  execute:
264  stat.propagate++;
265  // Keep old modification event delta
266  med_o = p->u.med;
267  // Clear med but leave propagator in queue
268  p->u.med = 0;
269  switch (p->propagate(*this,med_o)) {
270  case ES_FAILED:
271  // Count failure
272  if (afc_enabled())
273  gafc.fail(p->gafc);
274  // Mark as failed
275  fail(); s = SS_FAILED; goto exit;
276  case ES_NOFIX:
277  // Find next, if possible
278  if (p->u.med != 0) {
279  unstable:
280  // There is at least one propagator in a queue
281  do {
282  assert(pc.p.active >= &pc.p.queue[0]);
283  // First propagator or link back to queue
284  ActorLink* fst = pc.p.active->next();
285  if (pc.p.active != fst) {
286  p = Propagator::cast(fst);
287  goto execute;
288  }
289  pc.p.active--;
290  } while (true);
291  GECODE_NEVER;
292  }
293  // Fall through
294  case ES_FIX:
295  // Clear med and put into idle queue
296  p->u.med = 0; p->unlink(); pl.head(p);
297  stable_or_unstable:
298  // There might be a propagator in the queue
299  do {
300  assert(pc.p.active >= &pc.p.queue[0]);
301  // First propagator or link back to queue
302  ActorLink* fst = pc.p.active->next();
303  if (pc.p.active != fst) {
304  p = Propagator::cast(fst);
305  goto execute;
306  }
307  } while (--pc.p.active >= &pc.p.queue[0]);
308  assert(pc.p.active < &pc.p.queue[0]);
309  goto stable;
310  case __ES_SUBSUMED:
311  p->unlink(); rfree(p,p->u.size);
312  goto stable_or_unstable;
313  case __ES_PARTIAL:
314  // Schedule propagator with specified propagator events
315  assert(p->u.med != 0);
316  enqueue(p);
317  goto unstable;
318  default:
319  GECODE_NEVER;
320  }
321  }
322  stable:
323  /*
324  * Find the next brancher that has still alternatives left
325  *
326  * It is important to note that branchers reporting to have no more
327  * alternatives left cannot be deleted. They cannot be deleted
328  * as there might be choices to be used in commit
329  * that refer to one of these branchers. This e.g. happens when
330  * we combine branch-and-bound search with adaptive recomputation: during
331  * recomputation, a copy is constrained to be better than the currently
332  * best solution, then the first half of the choices are posted,
333  * and a fixpoint computed (for storing in the middle of the path). Then
334  * the remaining choices are posted, and because of the additional
335  * constraints that the space must be better than the previous solution,
336  * the corresponding Branchers may already have no alternatives left.
337  *
338  * The same situation may arise due to weakly monotonic propagators.
339  *
340  * A brancher reporting that no more alternatives exist is exhausted.
341  * All exhausted branchers will be left of the current pointer b_status.
342  * Only when it is known that no more choices
343  * can be used for commit an exhausted brancher can actually be deleted.
344  * This becomes known when choice is called.
345  */
346  while (b_status != Brancher::cast(&bl))
347  if (b_status->status(*this)) {
348  // Brancher still has choices to generate
349  s = SS_BRANCH; goto exit;
350  } else {
351  // Brancher is exhausted
352  b_status = Brancher::cast(b_status->next());
353  }
354  // No brancher with alternatives left, space is solved
355  s = SS_SOLVED;
356  exit:
357  stat.wmp = (wmp() > 0U);
358  if (wmp() == 1U)
359  wmp(0U);
360  return s;
361  }
362 
363 
364  const Choice*
366  if (!stable())
367  throw SpaceNotStable("Space::choice");
368  if (failed() || (b_status == Brancher::cast(&bl))) {
369  // There are no more choices to be generated
370  // Delete all branchers
371  Brancher* b = Brancher::cast(bl.next());
372  while (b != Brancher::cast(&bl)) {
373  Brancher* d = b;
374  b = Brancher::cast(b->next());
375  rfree(d,d->dispose(*this));
376  }
377  bl.init();
378  b_status = b_commit = Brancher::cast(&bl);
379  return NULL;
380  }
381  /*
382  * The call to choice() says that no older choices
383  * can be used. Hence, all branchers that are exhausted can be deleted.
384  */
385  Brancher* b = Brancher::cast(bl.next());
386  while (b != b_status) {
387  Brancher* d = b;
388  b = Brancher::cast(b->next());
389  d->unlink();
390  rfree(d,d->dispose(*this));
391  }
392  // Make sure that b_commit does not point to a deleted brancher!
393  b_commit = b_status;
394  return b_status->choice(*this);
395  }
396 
397  const Choice*
398  Space::choice(Archive& e) const {
399  unsigned int id; e >> id;
400  Brancher* b_cur = Brancher::cast(bl.next());
401  while (b_cur != Brancher::cast(&bl)) {
402  if (id == b_cur->id())
403  return b_cur->choice(*this,e);
404  b_cur = Brancher::cast(b_cur->next());
405  }
406  throw SpaceNoBrancher("Space::choice");
407  }
408 
409  void
410  Space::_commit(const Choice& c, unsigned int a) {
411  if (a >= c.alternatives())
412  throw SpaceIllegalAlternative("Space::commit");
413  if (failed())
414  return;
415  if (Brancher* b = brancher(c._id)) {
416  // There is a matching brancher
417  if (b->commit(*this,c,a) == ES_FAILED)
418  fail();
419  } else {
420  // There is no matching brancher!
421  throw SpaceNoBrancher("Space::commit");
422  }
423  }
424 
425  void
426  Space::_trycommit(const Choice& c, unsigned int a) {
427  if (a >= c.alternatives())
428  throw SpaceIllegalAlternative("Space::commit");
429  if (failed())
430  return;
431  if (Brancher* b = brancher(c._id)) {
432  // There is a matching brancher
433  if (b->commit(*this,c,a) == ES_FAILED)
434  fail();
435  }
436  }
437 
438  NGL*
439  Space::ngl(const Choice& c, unsigned int a) {
440  if (a >= c.alternatives())
441  throw SpaceIllegalAlternative("Space::ngl");
442  if (failed())
443  return NULL;
444  if (Brancher* b = brancher(c._id)) {
445  // There is a matching brancher
446  return b->ngl(*this,c,a);
447  } else {
448  return NULL;
449  }
450  }
451 
452  void
453  Space::print(const Choice& c, unsigned int a, std::ostream& o) const {
454  if (a >= c.alternatives())
455  throw SpaceIllegalAlternative("Space::print");
456  if (failed())
457  return;
458  if (Brancher* b = const_cast<Space&>(*this).brancher(c._id)) {
459  // There is a matching brancher
460  b->print(*this,c,a,o);
461  } else {
462  // There is no matching brancher!
463  throw SpaceNoBrancher("Space::print");
464  }
465  }
466 
467  void
468  Space::kill_brancher(unsigned int id) {
469  if (failed())
470  return;
471  for (Brancher* b = Brancher::cast(bl.next());
472  b != Brancher::cast(&bl); b = Brancher::cast(b->next()))
473  if (b->id() == id) {
474  // Make sure that neither b_status nor b_commit does not point to b
475  if (b_commit == b)
476  b_commit = Brancher::cast(b->next());
477  if (b_status == b)
478  b_status = Brancher::cast(b->next());
479  b->unlink();
480  rfree(b,b->dispose(*this));
481  return;
482  }
483  }
484 
485 
486 
487 
488  /*
489  * Space cloning
490  *
491  * Cloning is performed in two steps:
492  * - The space itself is copied by the copy constructor. This
493  * also copies all propagators, branchers, and variables.
494  * The copied variables are recorded.
495  * - In the second step the dependency information of the recorded
496  * variables is updated and their forwarding information is reset.
497  *
498  */
499  Space::Space(bool share, Space& s)
500  : sm(s.sm->copy(share)),
501  mm(sm,s.mm,s.pc.p.n_sub*sizeof(Propagator**)),
502  gafc(s.gafc),
503  d_fst(&Actor::sentinel),
504  _wmp_afc(s._wmp_afc) {
505 #ifdef GECODE_HAS_VAR_DISPOSE
506  for (int i=0; i<AllVarConf::idx_d; i++)
507  _vars_d[i] = NULL;
508 #endif
509  for (int i=0; i<AllVarConf::idx_c; i++)
510  pc.c.vars_u[i] = NULL;
511  pc.c.vars_noidx = NULL;
512  pc.c.shared = NULL;
513  pc.c.local = NULL;
514  // Copy all propagators
515  {
516  ActorLink* p = &pl;
517  ActorLink* e = &s.pl;
518  for (ActorLink* a = e->next(); a != e; a = a->next()) {
519  Actor* c = Actor::cast(a)->copy(*this,share);
520  // Link copied actor
521  p->next(ActorLink::cast(c)); ActorLink::cast(c)->prev(p);
522  // Note that forwarding is done in the constructors
523  p = c;
524  }
525  // Link last actor
526  p->next(&pl); pl.prev(p);
527  }
528  // Copy all branchers
529  {
530  ActorLink* p = &bl;
531  ActorLink* e = &s.bl;
532  for (ActorLink* a = e->next(); a != e; a = a->next()) {
533  Actor* c = Actor::cast(a)->copy(*this,share);
534  // Link copied actor
535  p->next(ActorLink::cast(c)); ActorLink::cast(c)->prev(p);
536  // Note that forwarding is done in the constructors
537  p = c;
538  }
539  // Link last actor
540  p->next(&bl); bl.prev(p);
541  }
542  // Setup brancher pointers
543  if (s.b_status == &s.bl) {
544  b_status = Brancher::cast(&bl);
545  } else {
546  b_status = Brancher::cast(s.b_status->prev());
547  }
548  if (s.b_commit == &s.bl) {
549  b_commit = Brancher::cast(&bl);
550  } else {
551  b_commit = Brancher::cast(s.b_commit->prev());
552  }
553  }
554 
555  Space*
556  Space::_clone(bool share) {
557  if (failed())
558  throw SpaceFailed("Space::clone");
559  if (!stable())
560  throw SpaceNotStable("Space::clone");
561 
562  // Copy all data structures (which in turn will invoke the constructor)
563  Space* c = copy(share);
564 
565  if (c->d_fst != &Actor::sentinel)
566  throw SpaceNotCloned("Space::clone");
567 
568  // Setup array for actor disposal in c
569  {
570  unsigned int n = static_cast<unsigned int>(d_cur - d_fst);
571  if (n == 0) {
572  // No actors
573  c->d_fst = c->d_cur = c->d_lst = NULL;
574  } else {
575  // Leave one entry free
576  c->d_fst = c->alloc<Actor*>(n+1);
577  c->d_cur = c->d_fst;
578  c->d_lst = c->d_fst+n+1;
579  for (Actor** d_fst_iter = d_fst; d_fst_iter != d_cur; d_fst_iter++) {
580  if ((*d_fst_iter)->prev())
581  *(c->d_cur++) = Actor::cast((*d_fst_iter)->prev());
582  }
583  }
584  }
585 
586  // Update variables without indexing structure
587  VarImp<NoIdxVarImpConf>* x =
588  static_cast<VarImp<NoIdxVarImpConf>*>(c->pc.c.vars_noidx);
589  while (x != NULL) {
590  VarImp<NoIdxVarImpConf>* n = x->next();
591  x->b.base = NULL; x->u.idx[0] = 0;
592  if (sizeof(ActorLink**) > sizeof(unsigned int))
593  *(1+&x->u.idx[0]) = 0;
594  x = n;
595  }
596  // Update variables with indexing structure
597  c->update(static_cast<ActorLink**>(c->mm.subscriptions()));
598 
599  // Re-establish prev links (reset forwarding information)
600  {
601  ActorLink* p_a = &pl;
602  ActorLink* c_a = p_a->next();
603  // First update propagators and advisors
604  while (c_a != &pl) {
605  Propagator* p = Propagator::cast(c_a);
606  if (p->u.advisors != NULL) {
607  ActorLink* a = p->u.advisors;
608  p->u.advisors = NULL;
609  do {
610  a->prev(p); a = a->next();
611  } while (a != NULL);
612  }
613  c_a->prev(p_a); p_a = c_a; c_a = c_a->next();
614  }
615  }
616  {
617  ActorLink* p_a = &bl;
618  ActorLink* c_a = p_a->next();
619  // Update branchers
620  while (c_a != &bl) {
621  c_a->prev(p_a); p_a = c_a; c_a = c_a->next();
622  }
623  }
624 
625  // Reset links for shared objects
626  for (SharedHandle::Object* s = c->pc.c.shared; s != NULL; s = s->next)
627  s->fwd = NULL;
628 
629  // Reset links for local objects
630  for (ActorLink* l = c->pc.c.local; l != NULL; l = l->next())
631  l->prev(NULL);
632 
633  // Initialize propagator queue
634  c->pc.p.active = &c->pc.p.queue[0]-1;
635  for (int i=0; i<=PropCost::AC_MAX; i++)
636  c->pc.p.queue[i].init();
637  // Copy propagation only data
638  c->pc.p.n_sub = pc.p.n_sub;
639  c->pc.p.branch_id = pc.p.branch_id;
640  return c;
641  }
642 
643  void
644  Space::constrain(const Space&) {
645  }
646 
647  void
648  Space::master(unsigned long int, const Space*, NoGoods& ng) {
649  ng.post(*this);
650  }
651 
652  void
653  Space::slave(unsigned long int, const Space*) {
654  }
655 
656  void
657  LocalObject::fwdcopy(Space& home, bool share) {
658  ActorLink::cast(this)->prev(copy(home,share));
659  next(home.pc.c.local);
660  home.pc.c.local = this;
661  }
662 
663  void
664  Choice::archive(Archive& e) const {
665  e << id();
666  }
667 
668  void
669  Space::afc_decay(double d) {
670  afc_enable();
671  // Commit outstanding decay operations
672  if (gafc.decay() != 1.0)
673  for (Propagators p(*this); p(); ++p)
674  (void) gafc.afc(p.propagator().gafc);
675  gafc.decay(d);
676  }
677 
678  void
679  Space::afc_set(double a) {
680  afc_enable();
681  for (Propagators p(*this); p(); ++p)
682  gafc.set(p.propagator().gafc,a);
683  }
684 
685 
686  bool
687  NGL::notice(void) const {
688  return false;
689  }
690 
691 }
692 
693 // STATISTICS: kernel-core
unsigned int propagators(void) const
Return number of propagators.
Definition: core.cpp:195
Space must be branched (at least one brancher left)
Definition: core.hpp:1266
NNF * l
Left subtree.
Definition: bool-expr.cpp:244
virtual void print(const Space &home, const Choice &c, unsigned int a, std::ostream &o) const
Print branch for choice c and alternative a.
Definition: core.cpp:96
Actor must always be disposed.
Definition: core.hpp:610
void id(CArray t1, int w1, int h1, Array t2, int &w2, int &h2)
Identity symmetry.
SpaceStatus
Space status
Definition: core.hpp:1263
Statistics for execution of commit
Definition: core.hpp:1309
struct Gecode::@511::NNF::@54::@55 b
For binary nodes (and, or, eqv)
virtual NGL * ngl(Space &home, const Choice &c, unsigned int a) const
Create no-good literal for choice c and alternative a.
Definition: core.cpp:91
Base-class for propagators.
Definition: core.hpp:755
Internal: propagator is subsumed, do not use.
Definition: core.hpp:524
Exception: Commit with illegal alternative
Definition: exception.hpp:76
Base-class for advisors.
Definition: core.hpp:926
bool wmp
Whether a weakly monotonic propagator might have been executed.
Definition: core.hpp:1278
Base-class for variable implementations.
Definition: core.hpp:243
unsigned long int propagate
Number of propagator executions.
Definition: core.hpp:1276
Propagation has computed fixpoint.
Definition: core.hpp:528
Computation spaces.
Definition: core.hpp:1325
virtual bool status(const Space &home) const =0
Check status of brancher, return true if alternatives left.
Base-class for both propagators and branchers.
Definition: core.hpp:666
Statistics for execution of status
Definition: core.hpp:1273
void fail(Counter &c)
Increment failure count.
Definition: global-afc.hpp:317
Gecode::IntSet d(v, 7)
Gecode::FloatVal c(-8, 8)
void print(const Choice &c, unsigned int a, std::ostream &o) const
Print branch for choice c and alternative a.
Definition: core.cpp:453
Maximal cost value.
Definition: core.hpp:556
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:236
Class to iterate over branchers of a space.
Definition: core.hpp:2247
Gecode::IntArgs i(4, 1, 2, 3, 4)
Base-class for branchers.
Definition: core.hpp:1071
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:238
Exception: Operation on not stable space invoked
Definition: exception.hpp:55
void release(SharedMemory *sm)
Release all allocated heap chunks.
Execution has resulted in failure.
Definition: core.hpp:525
Statistics for execution of clone
Definition: core.hpp:1293
bool failed(void) const
Check whether space is failed.
Definition: core.hpp:3365
void fail(void)
Fail space.
Definition: core.hpp:3351
virtual ~Space(void)
Destructor.
Definition: core.cpp:216
bool stable(void) const
Return if space is stable (at fixpoint or failed)
Definition: core.hpp:3374
virtual const Choice * choice(Space &home)=0
Return choice.
void flush(void)
Flush cached memory blocks.
Definition: core.cpp:211
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Advise function.
Definition: core.cpp:71
struct Gecode::@511::NNF::@54::@56 a
For atomic nodes.
unsigned int id(void) const
Return unsigned brancher id.
Definition: core.hpp:2959
Class to iterate over propagators of a space.
Definition: core.hpp:2221
friend class Brancher
Definition: core.hpp:1328
Node * x
Pointer to corresponding Boolean expression node.
Definition: bool-expr.cpp:253
Generic domain change information to be supplied to advisors.
Definition: core.hpp:275
Space(void)
Default constructor.
Definition: core.cpp:113
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
Definition: core.cpp:168
static const int idx_c
Index for cloning.
Definition: var-type.hpp:459
Choice for performing commit
Definition: core.hpp:1036
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
Definition: core.cpp:135
No-goods recorded from restarts.
Definition: core.hpp:1240
virtual size_t dispose(Space &home)
Delete actor and return its size.
Definition: core.hpp:2800
Archive representation
Definition: archive.hpp:45
Exception: Commit when no brancher present
Definition: exception.hpp:69
ExecStatus
Definition: core.hpp:523
struct Gecode::Space::@49::@51 c
Data available only during copying.
SpaceStatus status(StatusStatistics &stat=unused_status)
Query space status.
Definition: core.cpp:251
Internal: propagator has computed partial fixpoint, do not use.
Definition: core.hpp:530
Propagation has not computed fixpoint.
Definition: core.hpp:526
virtual void post(Space &home)
Post no-goods.
Definition: core.cpp:82
virtual void dispose(Space &home, VarImpBase *x)
Dispose list of variable implementations starting at x.
Definition: core.cpp:47
struct Gecode::Space::@49::@50 p
Data only available during propagation.
Gecode toplevel namespace
ActorProperty
Actor properties.
Definition: core.hpp:601
virtual ~VarImpDisposerBase(void)
Destructor (not used)
Definition: core.cpp:49
Space is failed
Definition: core.hpp:1264
const Choice * choice(void)
Create new choice for current brancher.
Definition: core.cpp:365
int ModEventDelta
Modification event deltas.
Definition: core.hpp:173
static const int idx_d
Index for dispose.
Definition: var-type.hpp:461
Shared object for several memory areas.
#define GECODE_NEVER
Assert that this command is never executed.
Definition: macros.hpp:60
NGL * ngl(const Choice &c, unsigned int a)
Create no-good literal for choice c and alternative a.
Definition: core.cpp:439
void flush(void)
Flush all cached memory.
unsigned int branchers(void) const
Return number of branchers.
Definition: core.cpp:203
Base class for Variable type disposer.
Definition: core.hpp:251
void rfree(void *p, size_t s)
Free memory previously allocated with alloc (might be reused later)
Definition: core.hpp:2320
bool release(void)
Release by one space.
Space is solved (no brancher left)
Definition: core.hpp:1265
No-good literal recorded during search.
Definition: core.hpp:971