public abstract class AbstractFlexibleOperator extends AbstractOperator
The AbstractGenericOperator relies on AbstractOperator and adds a mapping between "status" and a set of likely behaviours, including some hooks to quickly write custom operators without bothering with "common" cases.
A status is the relationship between the nodes being merged
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractFlexibleOperator.MergeAction
Supported actions while merging.
|
| Constructor and Description |
|---|
AbstractFlexibleOperator(AbstractFlexibleOperator.MergeAction A_LL)
Create a new operator.
|
AbstractFlexibleOperator(AbstractFlexibleOperator.MergeAction A_LL,
boolean multipleMerge)
Create a new operator
|
| Modifier and Type | Method and Description |
|---|---|
AbstractFlexibleOperator.MergeAction |
ask(MDDManager ddmanager,
NodeRelation status,
int first,
int other)
if some cases need more info to be tested, put the ASKME value in the array t
and implement this complementary function.
|
int |
combine(MDDManager ddmanager,
int first,
int other)
Combine two MDDs and return the result.
|
int |
custom(MDDManager ddmanager,
NodeRelation status,
int first,
int other)
put the CUSTOM value in t and implement this function to add more complex behaviours.
|
protected void |
lock()
Lock the operator so that the actions can no more be changed.
|
protected void |
setAction(NodeRelation rel,
AbstractFlexibleOperator.MergeAction action)
Define the action applied for a given relation between the merged nodes.
|
combine, multiple_leaves, recurse_multiple, recursepublic AbstractFlexibleOperator(AbstractFlexibleOperator.MergeAction A_LL, boolean multipleMerge)
By default, only the action for two leaves have to be defined, all others are set to recursive.
You can define additional actions by calling setAction.
A_LL - multipleMerge - public AbstractFlexibleOperator(AbstractFlexibleOperator.MergeAction A_LL)
By default, only the action for two leaves have to be defined, all others are set to recursive.
You can define additional actions by calling setAction.
A_LL - protected void setAction(NodeRelation rel, AbstractFlexibleOperator.MergeAction action)
Note: once the operation is locked, this method does nothing. It should be defined in the constructor and never change.
Override ask and/or custom if you plan to use the
ASKME and CUSTOM actions.
rel - action - protected void lock()
This should be done at the end of the constructor.
public int combine(MDDManager ddmanager, int first, int other)
MDDOperatorddmanager - the MDD manager in which the nodes are storedfirst - the root node of the first MDDother - the root node of the other MDDpublic AbstractFlexibleOperator.MergeAction ask(MDDManager ddmanager, NodeRelation status, int first, int other)
ddmanager - status - first - value or level of the first nodeother - value or level of the other nodepublic int custom(MDDManager ddmanager, NodeRelation status, int first, int other)
ddmanager - status - first - value or level of the first nodeother - value or level of the other nodeCopyright © 2009–2020. All rights reserved.