NaryOnePropagator.java
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 package org.gecode;
00025
00030 public abstract class NaryOnePropagator<GV extends GecodeView> extends Propagator {
00031 protected ViewArray<GV> iv;
00032 protected GV x;
00033 private PropCond pc;
00034
00038 public NaryOnePropagator(Space s, ViewArray<GV> iv0, GV x0, PropCond pc0) {
00039 iv = iv0;
00040 x = x0;
00041 pc = pc0;
00042 }
00045 @SuppressWarnings("unchecked")
00046 public NaryOnePropagator(Space s, boolean share,
00047 NaryOnePropagator<GV> p) {
00048 iv = new ViewArray<GV>(s, share, p.iv);
00049 x = (GV)p.x.copy(s, share);
00050 pc = p.pc;
00051 }
00052 public void dispose(Space home) {
00053 iv.cancel(home, this, pc);
00054 x.cancel(home, this, pc);
00055 }
00056 public ExecStatus setup(Space home) {
00057 iv.subscribe(home, this, pc);
00058 x.subscribe(home, this, pc);
00059 return ExecStatus.ES_OK;
00060 }
00061 }