BinaryPropagator.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 package org.gecode;
00023
00028 public abstract class BinaryPropagator<GV extends GecodeView> extends Propagator {
00029 protected GV x,y;
00030 private PropCond pc;
00031
00035 public BinaryPropagator(Space s, GV x0, GV y0, PropCond pc0) {
00036 x = x0;
00037 y = y0;
00038 pc = pc0;
00039 }
00042 @SuppressWarnings("unchecked")
00043 public BinaryPropagator(Space s, boolean share, BinaryPropagator p) {
00044 x = (GV)p.x.copy(s, share);
00045 y = (GV)p.y.copy(s, share);
00046 pc = p.pc;
00047 }
00048 public void dispose(Space home) {
00049 x.cancel(home, this,pc);
00050 y.cancel(home, this,pc);
00051 }
00052 public ExecStatus setup(Space home) {
00053 x.subscribe(home,this,pc);
00054 y.subscribe(home,this,pc);
00055 return ExecStatus.ES_OK;
00056 }
00057 }
00058