Cream version 1.06 Core API Specification

jp.ac.kobe_u.cs.cream
Class Trail

java.lang.Object
  extended by jp.ac.kobe_u.cs.cream.Trail

public class Trail
extends Object

Trail class implements trail stacks.

Since:
1.0
See Also:
DefaultSolver

Constructor Summary
Trail()
           
 
Method Summary
 void push(Variable v)
          Pushes a pair of the variable v and its domain to the trail stack.
 int size()
          Returns the size of the trail stack.
 void undo(int size0)
          Undoes the previous assignments by popping the variable-domain pair from the trail until the size becomes size0.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Trail

public Trail()
Method Detail

size

public int size()
Returns the size of the trail stack.

Returns:
the size

push

public void push(Variable v)
Pushes a pair of the variable v and its domain to the trail stack. This is invoked for each assignment to the variable by Variable.updateDomain(Domain, Trail).

Parameters:
v - the variable

undo

public void undo(int size0)
          throws EmptyStackException
Undoes the previous assignments by popping the variable-domain pair from the trail until the size becomes size0.

Parameters:
size0 - the size to be after undoing
Throws:
EmptyStackException

Cream version 1.06 Core API Specification

Cream: Constraint Programming Class Library for Java