Package net.sf.tweety.beliefdynamics.gui
Class RevisionCompareModel
- java.lang.Object
-
- net.sf.tweety.beliefdynamics.gui.RevisionCompareModel
-
public class RevisionCompareModel extends java.lang.ObjectThe data-model used to compare two different revision approaches. Two approaches can be selected using a list of approaches. The data-model also contains an ordered list of belief bases which define the ordering of the revision process. Observers are notified using the PropertyChangeListener.- Author:
- Tim Janus
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<java.util.Collection<?>>beliefBasesan ordered list of belief bases which are revised for the comparsation of the two selected revision methodsprivate java.beans.PropertyChangeSupportchangedelegator for the implementation of the PropertyChangeprotected booleanleftIterativeuse interactive revision for the left methodprotected BaseRevisionOperator<?>leftOperatorthe left revision operatorprotected booleanrightIterativeuse interactive revision for the right methodprotected BaseRevisionOperator<?>rightOperatorthe right revision operatorprotected java.util.Set<BaseRevisionOperator<?>>selectableOperatorsa set of selectable revison operators
-
Constructor Summary
Constructors Constructor Description RevisionCompareModel()
-
Method Summary
Modifier and Type Method Description voidaddBeliefbase(java.util.Collection<? extends Formula> beliefBase)Adds a belief base to the end of the ordered list of belief bases.voidaddListener(java.beans.PropertyChangeListener listener)Adds a property change listenervoidaddOperator(BaseRevisionOperator<?> op)Adds the given revision operator to the set of selectable revision methods.voidmoveBeliefbase(java.util.Collection<?> beliefBase, int dir)Moves the given belief base in the given direction.voidremoveBeliefbase(java.util.Collection<?> beliefBase)Removes a belief base from the ordered list of belief bases.voidremoveListener(java.beans.PropertyChangeListener listener)Removes a property change listenervoidremoveOperator(BaseRevisionOperator<?> op)Removes the given revision operator from the set of selectable revision methods.voidsetLeftIterative(boolean b)switches the flag indicating if the left method shall use iterative algorithmsvoidsetLeftOperator(BaseRevisionOperator<?> left)Select the left revision method.voidsetRightIterative(boolean b)switches the flag indicating if the right method shall use iterative algorithmsvoidsetRightOperator(BaseRevisionOperator<?> right)Select the right revision method.
-
-
-
Field Detail
-
change
private java.beans.PropertyChangeSupport change
delegator for the implementation of the PropertyChange
-
leftOperator
protected BaseRevisionOperator<?> leftOperator
the left revision operator
-
rightOperator
protected BaseRevisionOperator<?> rightOperator
the right revision operator
-
leftIterative
protected boolean leftIterative
use interactive revision for the left method
-
rightIterative
protected boolean rightIterative
use interactive revision for the right method
-
selectableOperators
protected java.util.Set<BaseRevisionOperator<?>> selectableOperators
a set of selectable revison operators
-
beliefBases
protected java.util.List<java.util.Collection<?>> beliefBases
an ordered list of belief bases which are revised for the comparsation of the two selected revision methods
-
-
Method Detail
-
addListener
public void addListener(java.beans.PropertyChangeListener listener)
Adds a property change listener- Parameters:
listener- Reference to the listener
-
removeListener
public void removeListener(java.beans.PropertyChangeListener listener)
Removes a property change listener- Parameters:
listener- Reference to the listener
-
setLeftOperator
public void setLeftOperator(BaseRevisionOperator<?> left)
Select the left revision method.- Parameters:
left- The revision method as an operator reference
-
setRightOperator
public void setRightOperator(BaseRevisionOperator<?> right)
Select the right revision method.- Parameters:
right- The revision method as an operator reference
-
addBeliefbase
public void addBeliefbase(java.util.Collection<? extends Formula> beliefBase)
Adds a belief base to the end of the ordered list of belief bases.- Parameters:
beliefBase- Reference to the new belief base
-
removeBeliefbase
public void removeBeliefbase(java.util.Collection<?> beliefBase)
Removes a belief base from the ordered list of belief bases.- Parameters:
beliefBase- Reference to the belief base which shall be removed.
-
moveBeliefbase
public void moveBeliefbase(java.util.Collection<?> beliefBase, int dir)Moves the given belief base in the given direction.- Parameters:
beliefBase- A belief base which is already in the ordered list of belief basesdir- Either -1 if the belief base shall move one index to the front of the list or 1 if the belief base shall move one unit index to the end of the list.
-
addOperator
public void addOperator(BaseRevisionOperator<?> op)
Adds the given revision operator to the set of selectable revision methods.- Parameters:
op- Reference to the operator, if the operator is in the set nothing happens
-
removeOperator
public void removeOperator(BaseRevisionOperator<?> op)
Removes the given revision operator from the set of selectable revision methods.- Parameters:
op- Reference to the operator which is removed if it is member of the set of revision methods.
-
setLeftIterative
public void setLeftIterative(boolean b)
switches the flag indicating if the left method shall use iterative algorithms- Parameters:
b- true means iterative, false means in one step.
-
setRightIterative
public void setRightIterative(boolean b)
switches the flag indicating if the right method shall use iterative algorithms- Parameters:
b- true means iterative, false means in one step.
-
-