inpro.incremental.unit
Class ContribIU

java.lang.Object
  extended by inpro.incremental.unit.IU
      extended by inpro.incremental.unit.ContribIU
All Implemented Interfaces:
java.lang.Comparable<IU>

public class ContribIU
extends IU

A contribution to larger dialogue/discourse.
Contributions initially live as a network of ContribIUs that can be integrated with input and that ground output. These actions are performed update mechanisms (e.g. rules).
The payload of a contribution consists of an attribute-value pair, with which input can be compared during integration. Contributions further contain strings with which an SDS can confirm, clarify or request information from the user, as well as a boolean clarify to determine whether they should be clarified against other contributions at all or just taken as the correct one as soon as possible. Lastly, it has a confidence, based on the number of grounding in- and outputs.

Author:
okko

Nested Class Summary
 
Nested classes/interfaces inherited from class inpro.incremental.unit.IU
IU.IUUpdateListener, IU.Progress
 
Field Summary
protected  boolean clarify
          Boolean for whether this contribution should be clarified against others in case of ambiguous input.
protected  int confidence
          This IU's confidence - initially 0.
protected  AVPair contribution
          This IU's payload - represented as an attribute-value pair
static ContribIU FIRST_CONTRIB_IU
           
protected  boolean overwrite
          Boolean for whether new input can overwrite existing input.
 
Fields inherited from class inpro.incremental.unit.IU
creationTime, FIRST_IU, groundedIn, grounds, nextSameLevelLinks, previousSameLevelLink, updateListeners
 
Constructor Summary
ContribIU()
          Empty constructor.
ContribIU(IU sll, IU grin, AVPair contribution, boolean clarify, boolean overwrite)
          Constructor with contribution and clarification parameters
ContribIU(IU sll, java.util.List<? extends IU> grin, AVPair contribution, boolean clarify, boolean overwrite)
          Constructor with contribution and clarification parameters
 
Method Summary
 boolean clarify()
          Checks if this contribution should be clarified in case of ambiguous input
 int confidence()
          Getter for this contribution's confidence.
 boolean equals(java.lang.Object iu)
          two IUs are equal if their IDs are the same
 AVPair getContribution()
          Getter for this IU's contribution's attribute-value pair representation.
 ContribIU getNext()
           
 ContribIU getNextDown()
           
 ContribIU getNextUp()
           
 ContribIU getPrevious()
           
 void ground(IU iu)
          Primitive way of increasing the confidence of this contribution the more it integrates with input.
 boolean integratesWith(IU iu)
           
 boolean isIntegrated()
          Checks if this contribution is grounded in at least one IU that is not another contribution
 boolean overwrite()
          Checks if this contribution can be grounded in new input even if already grounded.
 java.lang.String toPayLoad()
           
 
Methods inherited from class inpro.incremental.unit.IU
addNextSameLevelLink, addUpdateListener, commit, compareTo, connectSLL, deepToString, duration, endTime, getAge, getAmongNextSameLevelLinks, getCreationTime, getID, getNextSameLevelLink, getNextSameLevelLinks, getOngoingGroundedIU, getProgress, getSameLevelLink, groundedIn, groundIn, groundIn, grounds, hashCode, isCommitted, isCompleted, isOngoing, isRevoked, isUpcoming, notifyListeners, payloadEquals, removeAllNextSameLevelLinks, removeGrin, removeGrin, reorderNextSameLevelLink, revoke, setAsTopNextSameLevelLink, setSameLevelLink, startTime, toLabelLine, toString, toTEDviewXML, updateOnGrinUpdates
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

contribution

protected AVPair contribution
This IU's payload - represented as an attribute-value pair


confidence

protected int confidence
This IU's confidence - initially 0.


clarify

protected boolean clarify
Boolean for whether this contribution should be clarified against others in case of ambiguous input.


overwrite

protected boolean overwrite
Boolean for whether new input can overwrite existing input.


FIRST_CONTRIB_IU

public static final ContribIU FIRST_CONTRIB_IU
Constructor Detail

ContribIU

public ContribIU()
Empty constructor.


ContribIU

public ContribIU(IU sll,
                 IU grin,
                 AVPair contribution,
                 boolean clarify,
                 boolean overwrite)
Constructor with contribution and clarification parameters

Parameters:
sll - Same level link IU
grin - Grounded-in IU
contribution - AVPair describing this contribution
clarify - boolean denoting if this contribution should be disambiguated

ContribIU

public ContribIU(IU sll,
                 java.util.List<? extends IU> grin,
                 AVPair contribution,
                 boolean clarify,
                 boolean overwrite)
Constructor with contribution and clarification parameters

Parameters:
sll - Same level link IU
grin - Grounded-in IU
contribution - AVPair describing this contribution
clarify - boolean denoting if this contribution should be disambiguated
Method Detail

integratesWith

public boolean integratesWith(IU iu)

clarify

public boolean clarify()
Checks if this contribution should be clarified in case of ambiguous input

Returns:
true if so

overwrite

public boolean overwrite()
Checks if this contribution can be grounded in new input even if already grounded.

Returns:
true if so

getContribution

public AVPair getContribution()
Getter for this IU's contribution's attribute-value pair representation.

Returns:
the AVPair representation

getNext

public ContribIU getNext()

getPrevious

public ContribIU getPrevious()

getNextUp

public ContribIU getNextUp()

getNextDown

public ContribIU getNextDown()

isIntegrated

public boolean isIntegrated()
Checks if this contribution is grounded in at least one IU that is not another contribution

Returns:
true if so

ground

public void ground(IU iu)
Primitive way of increasing the confidence of this contribution the more it integrates with input.

Overrides:
ground in class IU

confidence

public int confidence()
Getter for this contribution's confidence.

Returns:
confidence

toPayLoad

public java.lang.String toPayLoad()
Specified by:
toPayLoad in class IU

equals

public boolean equals(java.lang.Object iu)
Description copied from class: IU
two IUs are equal if their IDs are the same

Overrides:
equals in class IU