public class PathSearcher extends Object implements Iterable<Integer>
It provides an integer array defining the path (reused for each path) and returns the leaf value for each path found. In the path representation, some variables may have undefined values, meaning that their value does not change the reached leaf.
It implements Iterable, so you can use a for loop on it directly.
Note that the bundled iterator will fill the path automatically, so that you do not have to call
fillPath explicitly but you will have to do it when using the raw searcher.
The same path searcher can be reused for different MDDs.
Warning: the provided iterator changes the instance: you can not use several iterators separately as their next() method will affect each other.
| Constructor and Description |
|---|
PathSearcher(MDDManager ddmanager)
Create a new path searcher accepting any value (negative leaves are not
allowed)
|
PathSearcher(MDDManager ddmanager,
boolean detectIntervals)
Create a new path searcher accepting any value (negative leaves are not
allowed) and detecting intervals
|
PathSearcher(MDDManager ddmanager,
int value)
Create a new path searcher, with a single value.
|
PathSearcher(MDDManager ddmanager,
int value,
boolean detectIntervals)
Create a new path searcher, with a single value and detecting intervals
|
PathSearcher(MDDManager ddmanager,
int minvalue,
int maxvalue)
Create a new path searcher, with a value range.
|
PathSearcher(MDDManager ddmanager,
int minvalue,
int maxvalue,
boolean detectIntervals) |
| Modifier and Type | Method and Description |
|---|---|
int |
countPaths()
Count the number of paths found for the current node.
|
int[] |
getMax()
Get the int[] used to store max values if this searcher detects intervals.
|
int[] |
getPath()
Get the int[] used to store the found path.
|
Iterator<Integer> |
iterator() |
int[] |
setNode(int node)
Start looking up path for a new node.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic PathSearcher(MDDManager ddmanager)
ddmanager - The MDD manager in which this search works.public PathSearcher(MDDManager ddmanager, boolean detectIntervals)
ddmanager - The MDD manager in which this search works.detectIntervals - public PathSearcher(MDDManager ddmanager, int value)
ddmanager - The MDD manager in which this search works.value - The value of the reached leafpublic PathSearcher(MDDManager ddmanager, int value, boolean detectIntervals)
ddmanager - The MDD manager in which this search works.value - The value of the reached leafpublic PathSearcher(MDDManager ddmanager, int minvalue, int maxvalue)
ddmanager - The MDD manager in which this search works.minvalue - minimal value of the reached leavesmaxvalue - maximal value of the reached leavespublic PathSearcher(MDDManager ddmanager, int minvalue, int maxvalue, boolean detectIntervals)
public int[] setNode(int node)
Note that the node must come from the same MDD manager. For performance reasons, the same array will be reused when searching for the next path, copy its content if you need to keep it.
node - a new node indexpublic int[] getPath()
public int[] getMax()
public int countPaths()
Copyright © 2009–2020. All rights reserved.