Generated on Fri Oct 6 16:26:44 2006 for Gecode/J by doxygen 1.4.7

NaryPropagator.java

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Mikael Lagerkvist <lagerkvist@gecode.org>
00004  *     Guido Tack <tack@gecode.org>
00005  *
00006  *  Copyright:
00007  *     Mikael Lagerkvist, 2006
00008  *     Guido Tack, 2006
00009  *
00010  *  Last modified:
00011  *     $Date: 2006-09-11 17:06:50 +0200 (Mon, 11 Sep 2006) $ by $Author: zayenz $
00012  *     $Revision: 3650 $
00013  *
00014  *  This file is part of Gecode, the generic constraint
00015  *  development environment:
00016  *     http://www.gecode.org
00017  *
00018  *  See the file "LICENSE" for information on usage and
00019  *  redistribution of this file, and for a
00020  *     DISCLAIMER OF ALL WARRANTIES.
00021  *
00022  */
00023 
00024 package org.gecode;
00025 
00030 public abstract class NaryPropagator<GV extends GecodeView> extends Propagator {
00031     protected ViewArray<GV> iv;
00032     private PropCond pc;
00033 
00037     public NaryPropagator(Space s, ViewArray<GV> iv0, PropCond pc0) {
00038         iv = iv0;
00039         pc = pc0;
00040     }
00043     public NaryPropagator(Space s, boolean share,
00044                     NaryPropagator<GV> p) {
00045         iv = new ViewArray<GV>(s, share, p.iv);
00046         pc = p.pc;
00047     }
00048     public void dispose(Space home) {
00049         iv.cancel(home, this, pc);
00050     }
00051     public ExecStatus setup(Space home) { 
00052         iv.subscribe(home, this, pc);
00053         return ExecStatus.ES_OK;
00054     }
00055 }