inpro.dm.isu
Class IUNetworkInformationState

java.lang.Object
  extended by inpro.dm.isu.AbstractInformationState
      extended by inpro.dm.isu.IUNetworkInformationState
All Implemented Interfaces:
AbstractIUNetworkRule.Effects, AbstractIUNetworkRule.Triggers, AbstractRule.Effects, AbstractRule.Triggers

public class IUNetworkInformationState
extends AbstractInformationState
implements AbstractIUNetworkRule.Triggers, AbstractIUNetworkRule.Effects

An information state consisting of a network of ContribIU contributions that can integrate with new input. Provides query methods for preconditions of update rule triggers and update methods for applying update rule effects. Update rules specify the manner in which the IS is searched for nodes to integrate input with. They can make recourse to these query and update methods, which in turn query the IU network or a number of special purpose placeholders for currently looked-at contributions, which contributions have been visited during recent search, which contributions integrate new input and what the nextOutput is.

Author:
okko

Field Summary
private  IUList<ContribIU> contributions
          The contributions network - a List of (ideally) networked ContribIU representing the total set of available nodes with which new input can be integrated
private  ContribIU currentContrib
          A variable that holds the contribution currently looked at while searching for contributions to integrate new input with.
private  ContribIU focus
          The focus ContribIU that represents the last node in the contributions network to integrate.
private  IUList<ContribIU> integrateList
          The list of contributions with which input can be integrated.
private  SemIU nextInput
          The next input variable - a WordIU that represents the next input word that was added or revoked to process
private  DialogueActIU nextOutput
          The DialogueActIU representing nextOutput added or revoked.
private  java.util.List<EditMessage<DialogueActIU>> outputEdits
          A list of edit messages produced as a result of (all previous and present) changes to the IS.
private  ContribIU root
          The root ContribIU that represents the first node in the contributions network.
private  IUList<ContribIU> visited
          A list of contributions that were visited during search.
 
Constructor Summary
IUNetworkInformationState()
          Generic constructor for an IUNetworkInformationState
IUNetworkInformationState(ContribIU root)
          Constructor building contributions network from a single root IU's grounded in links.
IUNetworkInformationState(IUList<ContribIU> contributions)
          Constructor building contributions network from a list of ContribIU's.
 
Method Summary
 boolean addCurrentContribToIntegrateList()
          An Effect method that updates the information state and returns true if successful.
private  void addGrinIUs(ContribIU iu)
          Convenience method that recursively adds any new IUs grounded in a given IU to the contributions network.
 boolean clarifyNextInput()
          An Effect method that updates the information state and returns true if successful.
 boolean currentContribGroundsSomething()
          A Precondition method that queries the information state.
 boolean currentContribHasNextSLL()
          A Precondition method that queries the information state.
 boolean currentContribHasSSL()
          A Precondition method that queries the information state.
 boolean currentContribIntegratesNextInput()
          A Precondition method that queries the information state.
 boolean currentContribIsGroundedInSomething()
          A Precondition method that queries the information state.
 IUList<ContribIU> getContributions()
          Getter for this IS's contributions network
 ContribIU getCurrentContrib()
          Getter method returning the IS's current contribution
 ContribIU getFocus()
          Getter for the current focus
private  ContribIU getLastIntegrated()
          A convenience method to look through currently active contributions returning whatever integrated last.
 java.util.List<EditMessage<DialogueActIU>> getNewEdits()
          Getter for the next output to perform.
 DialogueActIU getNextOutput()
          Getter for the next output to perform.
 boolean integrateListHasMoreThanOneMember()
          A Precondition method that queries the information state.
 boolean integrateListHasOneMember()
          A Precondition method that queries the information state.
 boolean integrateListIsEmpty()
          A Precondition method that queries the information state.
 boolean integrateNextInput()
          An Effect method that updates the information state and returns true if successful.
 boolean integrateNoEllipsis()
          An Effect method that updates the information state and returns true if successful.
 boolean integrateYesEllipsis()
          An Effect method that updates the information state and returns true if successful.
 boolean moveCurrentContribDown()
          An Effect method that updates the information state and returns true if successful.
 boolean moveCurrentContribLeft()
          An Effect method that updates the information state and returns true if successful.
 boolean moveCurrentContribRight()
          An Effect method that updates the information state and returns true if successful.
 boolean moveCurrentContribUp()
          An Effect method that updates the information state and returns true if successful.
 boolean nextInputIsNo()
          A Precondition method that queries the information state.
 boolean nextInputIsRevoked()
          A Precondition method that queries the information state.
 boolean nextInputIsYes()
          A Precondition method that queries the information state.
 boolean requestMoreInfoAboutFocus()
          An Effect method that updates the information state and returns true if successful.
 void setNextInput(SemIU sem)
          Setter method for the IS's next input to process.
 java.lang.String toString()
          Builds and returns a String representation of the IS.
 boolean unintegrateNextInput()
          An Effect method that updates the information state and returns true if successful.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nextInput

private SemIU nextInput
The next input variable - a WordIU that represents the next input word that was added or revoked to process


contributions

private IUList<ContribIU> contributions
The contributions network - a List of (ideally) networked ContribIU representing the total set of available nodes with which new input can be integrated


root

private ContribIU root
The root ContribIU that represents the first node in the contributions network.


focus

private ContribIU focus
The focus ContribIU that represents the last node in the contributions network to integrate.


currentContrib

private ContribIU currentContrib
A variable that holds the contribution currently looked at while searching for contributions to integrate new input with.


integrateList

private IUList<ContribIU> integrateList
The list of contributions with which input can be integrated. Filled during search and cleared afterwards.


visited

private IUList<ContribIU> visited
A list of contributions that were visited during search. Filled during search and cleared afterwards.


nextOutput

private DialogueActIU nextOutput
The DialogueActIU representing nextOutput added or revoked. Remains 'current' output until a new one is created.


outputEdits

private java.util.List<EditMessage<DialogueActIU>> outputEdits
A list of edit messages produced as a result of (all previous and present) changes to the IS.

Constructor Detail

IUNetworkInformationState

public IUNetworkInformationState()
Generic constructor for an IUNetworkInformationState


IUNetworkInformationState

public IUNetworkInformationState(IUList<ContribIU> contributions)
Constructor building contributions network from a list of ContribIU's. Root is assumed to be the first one if none have a payload designating it as root.

Parameters:
contributions - the list

IUNetworkInformationState

public IUNetworkInformationState(ContribIU root)
Constructor building contributions network from a single root IU's grounded in links.

Parameters:
root -
Method Detail

addGrinIUs

private void addGrinIUs(ContribIU iu)
Convenience method that recursively adds any new IUs grounded in a given IU to the contributions network.

Parameters:
iu - the IU and its GrIns to add to the contribution network.

setNextInput

public void setNextInput(SemIU sem)
Setter method for the IS's next input to process.

Parameters:
sem - the next semantic input to process.

getNextOutput

public DialogueActIU getNextOutput()
Getter for the next output to perform.

Returns:
nextOutput

getFocus

public ContribIU getFocus()
Getter for the current focus

Returns:
focus

getNewEdits

public java.util.List<EditMessage<DialogueActIU>> getNewEdits()
Getter for the next output to perform.


getContributions

public IUList<ContribIU> getContributions()
Getter for this IS's contributions network

Returns:
contributions the list of ContribIUs

getCurrentContrib

public ContribIU getCurrentContrib()
Getter method returning the IS's current contribution

Returns:
currentContrib this IS's current ContribIU

getLastIntegrated

private ContribIU getLastIntegrated()
A convenience method to look through currently active contributions returning whatever integrated last.

Returns:
the last contribution to integrate

nextInputIsRevoked

public boolean nextInputIsRevoked()
A Precondition method that queries the information state. Checks if the IS's next input was revoked.

Specified by:
nextInputIsRevoked in interface AbstractIUNetworkRule.Triggers
Returns:
true if so

addCurrentContribToIntegrateList

public boolean addCurrentContribToIntegrateList()
An Effect method that updates the information state and returns true if successful. The current contribution is added to the list of potential candidates for integration.

Specified by:
addCurrentContribToIntegrateList in interface AbstractIUNetworkRule.Effects
Returns:
true if successful

moveCurrentContribRight

public boolean moveCurrentContribRight()
An Effect method that updates the information state and returns true if successful. Moves the current contribution right to its next SLL contribution.

Specified by:
moveCurrentContribRight in interface AbstractIUNetworkRule.Effects
Returns:
true if successful

moveCurrentContribUp

public boolean moveCurrentContribUp()
An Effect method that updates the information state and returns true if successful. Moves the current contribution up to its first grounding contribution.

Specified by:
moveCurrentContribUp in interface AbstractIUNetworkRule.Effects
Returns:
true if successful

moveCurrentContribLeft

public boolean moveCurrentContribLeft()
An Effect method that updates the information state and returns true if successful. Attempts moving the current contrib to the left (SLL).

Specified by:
moveCurrentContribLeft in interface AbstractIUNetworkRule.Effects
Returns:
true if successful

moveCurrentContribDown

public boolean moveCurrentContribDown()
An Effect method that updates the information state and returns true if successful. Attempts moving the current contrib down to the first grounded-in contribution.

Specified by:
moveCurrentContribDown in interface AbstractIUNetworkRule.Effects
Returns:
true if successful

unintegrateNextInput

public boolean unintegrateNextInput()
An Effect method that updates the information state and returns true if successful. Removes grin links between input and any contributions grounded in it. Also re-grounds previous input.

Specified by:
unintegrateNextInput in interface AbstractIUNetworkRule.Effects
Returns:
true if successful

integrateNextInput

public boolean integrateNextInput()
An Effect method that updates the information state and returns true if successful. Integrates the current contribution with the next input if possible. Clears next input and integrated and visited contributions list to restart the search with new input.

Specified by:
integrateNextInput in interface AbstractIUNetworkRule.Effects
Returns:
true if successful

integrateYesEllipsis

public boolean integrateYesEllipsis()
An Effect method that updates the information state and returns true if successful. Ground contributions grounded-in any last output in current 'yes' input.

Specified by:
integrateYesEllipsis in interface AbstractIUNetworkRule.Effects
Returns:
true if successful

integrateNoEllipsis

public boolean integrateNoEllipsis()
An Effect method that updates the information state and returns true if successful. Revokes last output and grin links to any contributions it grounds.

Specified by:
integrateNoEllipsis in interface AbstractIUNetworkRule.Effects
Returns:
true if successful

clarifyNextInput

public boolean clarifyNextInput()
An Effect method that updates the information state and returns true if successful.

Specified by:
clarifyNextInput in interface AbstractIUNetworkRule.Effects
Returns:
true if successful

requestMoreInfoAboutFocus

public boolean requestMoreInfoAboutFocus()
An Effect method that updates the information state and returns true if successful.

Specified by:
requestMoreInfoAboutFocus in interface AbstractIUNetworkRule.Effects
Returns:
true if successful

currentContribIntegratesNextInput

public boolean currentContribIntegratesNextInput()
A Precondition method that queries the information state. Checks if the IS's current contribution can integrate with next input. This is the case if the current contribution hasn't already integrated with current input during search and isn't already grounded in other input. In addition, if another contribution that doesn't require clarification also integrates, the current one is barred from integration. Barring these conditions, a payload check is performed to check if integration is possible. Also tracks the contributions tries during the current search by adding the current contribution to the visited list.

Specified by:
currentContribIntegratesNextInput in interface AbstractIUNetworkRule.Triggers
Returns:
true if so

currentContribHasNextSLL

public boolean currentContribHasNextSLL()
A Precondition method that queries the information state. Checks if the IS's current contribution has a subsequent SLL that has not been visited during search (visited SLL return false because the IS implements a top-down search.)

Specified by:
currentContribHasNextSLL in interface AbstractIUNetworkRule.Triggers
Returns:
true if so

currentContribGroundsSomething

public boolean currentContribGroundsSomething()
A Precondition method that queries the information state. Checks if the IS's current contribution grounds another contribution that hasn't been visited yet.

Specified by:
currentContribGroundsSomething in interface AbstractIUNetworkRule.Triggers
Returns:
true if so

currentContribHasSSL

public boolean currentContribHasSSL()
A Precondition method that queries the information state. Checks if the IS's current contribution has a SLL.

Specified by:
currentContribHasSSL in interface AbstractIUNetworkRule.Triggers
Returns:
true if so

currentContribIsGroundedInSomething

public boolean currentContribIsGroundedInSomething()
A Precondition method that queries the information state. Checks if the IS's current contribution is grounded in another contribution. The root contribution is not grounded in another contribution.

Specified by:
currentContribIsGroundedInSomething in interface AbstractIUNetworkRule.Triggers
Returns:
true if so

integrateListHasOneMember

public boolean integrateListHasOneMember()
A Precondition method that queries the information state. Checks if the IS's integrate list has exactly one member contribution or several of which at least one doesn't require clarification. that integrates with current input.

Specified by:
integrateListHasOneMember in interface AbstractIUNetworkRule.Triggers
Returns:
true if so

integrateListHasMoreThanOneMember

public boolean integrateListHasMoreThanOneMember()
A Precondition method that queries the information state. Checks if the IS's integrate list has more than one member contribution that integrates with current input.

Specified by:
integrateListHasMoreThanOneMember in interface AbstractIUNetworkRule.Triggers
Returns:
true if so

integrateListIsEmpty

public boolean integrateListIsEmpty()
A Precondition method that queries the information state. Checks if the IS's integrate list is empty.

Specified by:
integrateListIsEmpty in interface AbstractIUNetworkRule.Triggers
Returns:
true if so

nextInputIsNo

public boolean nextInputIsNo()
A Precondition method that queries the information state. Checks if the IS's next input is bool:true

Specified by:
nextInputIsNo in interface AbstractIUNetworkRule.Triggers
Returns:
true if so

nextInputIsYes

public boolean nextInputIsYes()
A Precondition method that queries the information state. Checks if the IS's next input is bool:false

Specified by:
nextInputIsYes in interface AbstractIUNetworkRule.Triggers
Returns:
true if so

toString

public java.lang.String toString()
Builds and returns a String representation of the IS.

Overrides:
toString in class java.lang.Object
Returns:
string the String representation