reasoner
Class PreferenceReasoner

java.lang.Object
  extended by reasoner.PreferenceReasoner
Direct Known Subclasses:
AcyclicCPNetReasoner

public abstract class PreferenceReasoner
extends java.lang.Object

The abstract class that defines the model checking based preference reasoning tasks

Author:
gsanthan

Field Summary
 boolean consistent
          Consistency of the preference specification (cycle-freeness of the induced preference graph)
static java.util.List<java.lang.String[]> currentMaximalOutcomes
          List of non-dominated outcomes computed until now
static java.util.List<java.lang.String> invariants
          List of specs to be added when computing next-preferred outcomes at levels lower than the most preferred outcomes
static OutcomeSequence outcomesInOrder
          Sequence of outcomes in a total order consistent with the induced preference graph
 java.lang.String smvFile
          The SMV model file
 java.lang.String[] variables
          Preference variables in the model
 
Method Summary
static int addOutcomeSequenceToGeneratedSequence(OutcomeSequence outcomeSequence)
          Keeps track of all outcomes generated in the session - includes the outcomeSequence as part of the generated set
static int addOutcomeToGeneratedSequence(java.util.Set<java.lang.String> outcome)
          Keeps track of all outcomes generated in the session - includes the outcome as a part of the generated set
abstract  OutcomeSequence computeCurrentPreferredSet()
          Computes the set of outcomes currently at the top-most level
abstract  OutcomeSequence computeNextPreferredSetIgnoring(OutcomeSequence ignoredOutcomes)
          Computes the set of outcomes at the top-most level when the ignoredOutcomes are removed from the induced preference graph
abstract  boolean dominates(java.util.Set<java.lang.String> morePreferredOutcome, java.util.Set<java.lang.String> lessPreferredOutcome)
          Dominance Testing: Does morePreferredOutcome dominate lessPreferredOutcome? Returns true or false.
abstract  java.util.List<OutcomeSequence> generateWeakOrder()
          Computes a sequence of set of outcomes at subsequent levels in an optimistic minimal weak order extension consistent with the induced preference graph.
static java.util.List<java.lang.String> getInvariants()
          Returns a list of specs used to remove outcomes as needed to simulate the in-session reasoning tasks
 int getOutcomeCount()
          Returns the number of outcomes generated in session so far
abstract  boolean isConsistent()
          Consistency Testing: Is the induced preference graph cycle-free? Returns true or false.
abstract  java.util.Set<java.lang.String> nextPreferred()
          Returns the next preferred outcome in a total ordering consistent with the induced preference graph.
abstract  void removeOutcomes(OutcomeSequence outcomes)
          Removes specified outcomes in the induced preference graph from the model
 void resetGeneratedOutcomes()
          Resets the session of the reasoner
abstract  void resetReasoner()
          Resets the session and makes the reasoner ready for computing the next preferred outcomes in sequence from the top most level.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

smvFile

public java.lang.String smvFile
The SMV model file


variables

public java.lang.String[] variables
Preference variables in the model


consistent

public boolean consistent
Consistency of the preference specification (cycle-freeness of the induced preference graph)


currentMaximalOutcomes

public static java.util.List<java.lang.String[]> currentMaximalOutcomes
List of non-dominated outcomes computed until now


invariants

public static java.util.List<java.lang.String> invariants
List of specs to be added when computing next-preferred outcomes at levels lower than the most preferred outcomes


outcomesInOrder

public static OutcomeSequence outcomesInOrder
Sequence of outcomes in a total order consistent with the induced preference graph

Method Detail

dominates

public abstract boolean dominates(java.util.Set<java.lang.String> morePreferredOutcome,
                                  java.util.Set<java.lang.String> lessPreferredOutcome)
                           throws java.lang.Exception
Dominance Testing: Does morePreferredOutcome dominate lessPreferredOutcome? Returns true or false.

Parameters:
morePreferredOutcome -
lessPreferredOutcome -
Returns:
Result of dominance testing: true or false
Throws:
java.lang.Exception

isConsistent

public abstract boolean isConsistent()
                              throws java.lang.Exception
Consistency Testing: Is the induced preference graph cycle-free? Returns true or false.

Returns:
Result of consistency testing: true or false
Throws:
java.lang.Exception

nextPreferred

public abstract java.util.Set<java.lang.String> nextPreferred()
                                                       throws java.io.IOException
Returns the next preferred outcome in a total ordering consistent with the induced preference graph. Note: This method has to be called within a session.

Returns:
next preferred outcome
Throws:
java.io.IOException

resetReasoner

public abstract void resetReasoner()
Resets the session and makes the reasoner ready for computing the next preferred outcomes in sequence from the top most level.


computeNextPreferredSetIgnoring

public abstract OutcomeSequence computeNextPreferredSetIgnoring(OutcomeSequence ignoredOutcomes)
                                                         throws java.io.IOException
Computes the set of outcomes at the top-most level when the ignoredOutcomes are removed from the induced preference graph

Parameters:
ignoredOutcomes -
Returns:
The non-dominated set of elements in the current model when ignoredOutcomes are removed
Throws:
java.io.IOException

computeCurrentPreferredSet

public abstract OutcomeSequence computeCurrentPreferredSet()
                                                    throws java.io.IOException
Computes the set of outcomes currently at the top-most level

Returns:
The set of non-dominated elements in the current model used
Throws:
java.io.IOException

generateWeakOrder

public abstract java.util.List<OutcomeSequence> generateWeakOrder()
                                                           throws java.io.IOException
Computes a sequence of set of outcomes at subsequent levels in an optimistic minimal weak order extension consistent with the induced preference graph.

Returns:
List of set of outcomes (corresponding to each level in the weak order)
Throws:
java.io.IOException

removeOutcomes

public abstract void removeOutcomes(OutcomeSequence outcomes)
Removes specified outcomes in the induced preference graph from the model

Parameters:
outcomes -

getOutcomeCount

public int getOutcomeCount()
Returns the number of outcomes generated in session so far

Returns:
Number of outcomes generated in session so far

resetGeneratedOutcomes

public void resetGeneratedOutcomes()
Resets the session of the reasoner


addOutcomeSequenceToGeneratedSequence

public static int addOutcomeSequenceToGeneratedSequence(OutcomeSequence outcomeSequence)
                                                 throws java.io.IOException
Keeps track of all outcomes generated in the session - includes the outcomeSequence as part of the generated set

Parameters:
outcomeSequence -
Returns:
Total number of outcomes generated so far
Throws:
java.io.IOException

addOutcomeToGeneratedSequence

public static int addOutcomeToGeneratedSequence(java.util.Set<java.lang.String> outcome)
                                         throws java.io.IOException
Keeps track of all outcomes generated in the session - includes the outcome as a part of the generated set

Parameters:
outcome -
Returns:
Total number of outcomes generated so far
Throws:
java.io.IOException

getInvariants

public static java.util.List<java.lang.String> getInvariants()
Returns a list of specs used to remove outcomes as needed to simulate the in-session reasoning tasks

Returns:
A List of invariants as formulas corresponding to negation of the outcomes excluded from the model