|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.myra.framework.DefaultTrailFactory
public class DefaultTrailFactory
Default implementation of the TrailFactory
interface. The factory
creates a trail using the TRAIL_CLASS_KEY
and select a vertex
to add to the trail according to the DecisionPolicy
instance.
The returned vertex is then evaluated by the constraints. If no constraint
is violated, it is added to the trail; otherwise, a new vertex is selected.
This process goes until a NoAvailableVertexException
is thrown by
the DecisionPolicy
instance.
DecisionPolicy
Constructor Summary | |
---|---|
DefaultTrailFactory(Graph<?> graph,
DecisionPolicy policy)
Default constructor. |
Method Summary | |
---|---|
void |
addConstraint(Constraint constraint)
Adds a trail construction constraint. |
Trail |
createTrail()
Returns a new trail. |
java.util.Collection<Constraint> |
getConstraints()
Returns the list of trail construction constraints. |
DecisionPolicy |
getDecisionPolicy()
Returns the trail construction policy. |
Graph<?> |
getGraph()
Returns the problem graph. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultTrailFactory(Graph<?> graph, DecisionPolicy policy)
policy
- the trail construction policy.Method Detail |
---|
public void addConstraint(Constraint constraint)
constraint
- the constraint to be added.public java.util.Collection<Constraint> getConstraints()
public DecisionPolicy getDecisionPolicy()
public Graph<?> getGraph()
getGraph
in interface TrailFactory
public Trail createTrail()
TrailFactory
createTrail
in interface TrailFactory
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |