public class PRule extends BasicName implements Rule
Constructor and Description |
---|
PRule() |
PRule(PRule rule) |
PRule(java.lang.String name,
java.lang.String... dims) |
Modifier and Type | Method and Description |
---|---|
void |
addCondition(Condition condition)
Add new condition
|
void |
addResult(Result result)
Add new result
|
PRule |
deepClone()
Clone the name
|
int |
fetch(Membrane membrane,
int times)
Fetch objects from membrane
|
void |
fix(java.util.Map<java.lang.String,java.lang.Object> mappedValues)
Fix all the dimension by calculating them using the mapped values
|
java.util.List<Condition> |
getConditions()
Get the condition list of this rule
|
java.util.List<Result> |
getResults()
Get the result list of this rule
|
java.util.Map<Rule,java.lang.Integer> |
satisfiedRules(Membrane membrane)
Rule with dimensions check all the satisfied rule of it.
|
int |
satisfy(Membrane membrane)
Check if all the conditions are satisfied at once.
|
java.lang.String |
toString() |
addDimension, addDimension, addDimension, get, getDimensions, getDimensionSize, getName, getNameDim, isFixed, predictPossibleValue, predictPossibleValueOfNeighbor, predictPossibleValueOfObjects, predictPossibleValueOfSubmembrane, setName
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getRuleSet, registRuleSet
getName, getNameDim, setName
addDimension, addDimension, addDimension, get, getDimensions, getDimensionSize, isFixed, predictPossibleValue
public PRule(java.lang.String name, java.lang.String... dims)
public PRule()
public PRule(PRule rule)
public int satisfy(Membrane membrane)
Rule
public int fetch(Membrane membrane, int times)
Rule
public void addCondition(Condition condition)
Rule
addCondition
in interface Rule
condition
- new conditionpublic void addResult(Result result)
Rule
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.List<Condition> getConditions()
Rule
getConditions
in interface Rule
public java.util.List<Result> getResults()
Rule
getResults
in interface Rule
public java.util.Map<Rule,java.lang.Integer> satisfiedRules(Membrane membrane) throws UnpredictableDimensionException, java.lang.CloneNotSupportedException
satisfiedRules
in interface Rule
membrane
- the test membraneUnpredictableDimensionException
- if rule has dimension whose value cannot be predictedjava.lang.CloneNotSupportedException
- if clone failedpublic void fix(java.util.Map<java.lang.String,java.lang.Object> mappedValues)
Dimensional
fix
in interface Dimensional
fix
in class BasicName
mappedValues
- mapped values