Orbital library

orbital.algorithm.template
Class LocalOptimizerSearch.OptionIterator

java.lang.Object
  extended by orbital.algorithm.template.LocalOptimizerSearch.OptionIterator
All Implemented Interfaces:
java.io.Serializable, java.util.Iterator
Enclosing class:
LocalOptimizerSearch

public abstract static class LocalOptimizerSearch.OptionIterator
extends java.lang.Object
implements java.util.Iterator, java.io.Serializable

An iterator over a state space in "choosy" random order.

It will pick a random move, but only accept some transitions.

Author:
André Platzer
See Also:
TransitionPath, Serialized Form

Constructor Summary
LocalOptimizerSearch.OptionIterator(GeneralSearchProblem problem, LocalOptimizerSearch algorithm)
           
 
Method Summary
protected abstract  boolean accept(java.lang.Object state, java.lang.Object sp)
          The predicate asked whether to accept a transition.
protected  LocalOptimizerSearch getAlgorithm()
          Get the algorithm using this (randomized) iterator.
protected  GeneralSearchProblem getProblem()
          Get the current problem.
protected  java.lang.Object getState()
          Get the current state s∈S of this transition path.
abstract  boolean hasNext()
          Decides whether to stop further transitions.
 java.lang.Object next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalOptimizerSearch.OptionIterator

public LocalOptimizerSearch.OptionIterator(GeneralSearchProblem problem,
                                           LocalOptimizerSearch algorithm)
Method Detail

getProblem

protected final GeneralSearchProblem getProblem()
Get the current problem.

Returns:
the problem specified in the last call to solve.
Preconditions:
true

getAlgorithm

protected final LocalOptimizerSearch getAlgorithm()
Get the algorithm using this (randomized) iterator.


getState

protected final java.lang.Object getState()
Get the current state s∈S of this transition path. i.e. the last state returned by next(), or the initial state if no transition has already occurred.


next

public java.lang.Object next()
Specified by:
next in interface java.util.Iterator

accept

protected abstract boolean accept(java.lang.Object state,
                                  java.lang.Object sp)
The predicate asked whether to accept a transition.
s→asʹ is accepted (and performed) iff accept(s,sʹ)


hasNext

public abstract boolean hasNext()
Decides whether to stop further transitions. The predicate asked whether to continue or stop further transition.
transitions are continued further iff cont(s)
where s is the current state.

Specified by:
hasNext in interface java.util.Iterator

remove

public void remove()
Specified by:
remove in interface java.util.Iterator

Orbital library
1.3.0: 11 Apr 2009

Copyright © 1996-2009 André Platzer
All Rights Reserved.