org.processmining.framework.models.recommendation
Class Recommendation

java.lang.Object
  extended by org.processmining.framework.models.recommendation.Recommendation
All Implemented Interfaces:
java.lang.Comparable<Recommendation>

public class Recommendation
extends java.lang.Object
implements java.lang.Comparable<Recommendation>

A simple data structure for storing recommendations, i.e. that a specific task should be executed and the confidence with which this is recommended. Optionally, the recommendation may also contain the resource specification for which it applies.

Author:
Christian W. Guenther (christian@deckfour.org)

Field Summary
 double confidence
           
 java.lang.String eventType
           
protected  java.util.SortedSet<java.lang.String> groups
           
 java.lang.String rationale
           
protected  java.util.SortedSet<java.lang.String> roles
           
 java.lang.String task
           
protected  java.util.SortedSet<java.lang.String> users
           
 double weight
           
 
Constructor Summary
Recommendation()
          Creates a new, pristine recommendation.
Recommendation(java.lang.String task, double confidence, java.lang.String rationale, java.lang.String eventType, java.util.SortedSet<java.lang.String> users, java.util.SortedSet<java.lang.String> roles, java.util.SortedSet<java.lang.String> groups, int support)
          Creates a new recommendation.
 
Method Summary
 void addGroup(java.lang.String aGroup)
          Adds a group for which this recommendation holds
 void addRecomendation(Recommendation r)
           
 void addRole(java.lang.String aRole)
          Adds a role for which this recommendation holds
 void addUser(java.lang.String aUser)
          Adds a user for which this recommendation holds
 int compareTo(Recommendation rec)
          The compareTo method is implemented based on the confidence of the recommendation.
 boolean equals(java.lang.Object o)
           
 double getConfidence()
           
 java.lang.String getEventType()
          optional: may return null if not set!
 java.util.SortedSet<java.lang.String> getGroups()
          optional: may return null if not set!
 java.lang.String getRationale()
          optional: may return null if not set!
 java.util.SortedSet<java.lang.String> getRoles()
          optional: may return null if not set!
 java.lang.String getTask()
           
 java.util.SortedSet<java.lang.String> getUsers()
          optional: may return null if not set!
 double getWeight()
           
 void setConfidence(double aConfidence)
          Sets the confidence of this recommendation
 void setEventType(java.lang.String anEventType)
          Sets the recommended event type
 void setRationale(java.lang.String aRationale)
          Sets the rationale for this recommendation
 void setTask(java.lang.String aTask)
          Sets the recommended task
 void setWeight(double aSup)
          Sets the support of this recommendation
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

task

public java.lang.String task

eventType

public java.lang.String eventType

confidence

public double confidence

rationale

public java.lang.String rationale

users

protected java.util.SortedSet<java.lang.String> users

roles

protected java.util.SortedSet<java.lang.String> roles

groups

protected java.util.SortedSet<java.lang.String> groups

weight

public double weight
Constructor Detail

Recommendation

public Recommendation()
Creates a new, pristine recommendation.


Recommendation

public Recommendation(java.lang.String task,
                      double confidence,
                      java.lang.String rationale,
                      java.lang.String eventType,
                      java.util.SortedSet<java.lang.String> users,
                      java.util.SortedSet<java.lang.String> roles,
                      java.util.SortedSet<java.lang.String> groups,
                      int support)
Creates a new recommendation.

Parameters:
task - The name of the task which is recommended.
confidence - Confidence of the recommendation (should be within [0, 1])
rationale - optional: A human-readable description of why this is recommended
eventType - optional: The suggested event type to be triggered.
users - optional: the set of users to which this recommendation applies.
roles - optional: the set of roles to which this recommendation applies.
groups - optional: the set of groups to which this recommendation applies.
support - optional: a weight for the basis of this decision.
Method Detail

setTask

public void setTask(java.lang.String aTask)
Sets the recommended task

Parameters:
aTask -

setEventType

public void setEventType(java.lang.String anEventType)
Sets the recommended event type

Parameters:
anEventType -

setConfidence

public void setConfidence(double aConfidence)
Sets the confidence of this recommendation

Parameters:
aConfidence - double value within [0, 1]

setWeight

public void setWeight(double aSup)
Sets the support of this recommendation

Parameters:
aConfidence - double value within [0, 1]

setRationale

public void setRationale(java.lang.String aRationale)
Sets the rationale for this recommendation

Parameters:
aRationale - human-readable justification or explanation string

addUser

public void addUser(java.lang.String aUser)
Adds a user for which this recommendation holds

Parameters:
aUser -

addRole

public void addRole(java.lang.String aRole)
Adds a role for which this recommendation holds

Parameters:
aRole -

addGroup

public void addGroup(java.lang.String aGroup)
Adds a group for which this recommendation holds

Parameters:
aGroup -

getTask

public java.lang.String getTask()
Returns:
the recommended task

getEventType

public java.lang.String getEventType()
optional: may return null if not set!

Returns:
the recommended event type

getConfidence

public double getConfidence()
Returns:
confidence value of the recommendation (should be within [0, 1])

getWeight

public double getWeight()
Returns:
supprt value of the recommendation

getRationale

public java.lang.String getRationale()
optional: may return null if not set!

Returns:
a human-readable justification for this recommendation

getUsers

public java.util.SortedSet<java.lang.String> getUsers()
optional: may return null if not set!

Returns:
the set of users to which this recommendation applies.

getRoles

public java.util.SortedSet<java.lang.String> getRoles()
optional: may return null if not set!

Returns:
the set of roles to which this recommendation applies.

getGroups

public java.util.SortedSet<java.lang.String> getGroups()
optional: may return null if not set!

Returns:
the set of groups to which this recommendation applies.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(Recommendation rec)
The compareTo method is implemented based on the confidence of the recommendation. This means that it does NOT necessarily coincide with the equals() method's results!

Specified by:
compareTo in interface java.lang.Comparable<Recommendation>

addRecomendation

public void addRecomendation(Recommendation r)
                      throws NotEqualRecommendationException
Throws:
NotEqualRecommendationException