CoPS.agents
Class CoPSProblemSolver

java.lang.Object
  extended byAgent
      extended byCoPS.agents.CoPSAgent
          extended byCoPS.agents.CoPSProblemSolver
Direct Known Subclasses:
DiagnosisAgent, LaboratoryAgent, LabSystemAgent, PatientDBAgent, PhysicianAgent, ReceptionistAgent

public abstract class CoPSProblemSolver
extends CoPSAgent

This class implements the (abstract) Problem Solver agent of the CoPS framework. Modified by Kari Roessland.

See Also:
Serialized Form

Constructor Summary
CoPSProblemSolver()
           
 
Method Summary
protected abstract  boolean deceideWhetherToMakeProposal(ACLMessage request)
          Method for deceiding whether to make a proposal or not.
protected  ACLMessage getCurrentRequest()
          Method for getting the problem this agent has agreed to solve.
protected  Codec[] getLanguages()
           
protected  boolean getPartOfTeam()
          The method getPartOfTeam returns true if the agent is part of a team and false if it is not.
protected abstract  Codec[] initializeLanguages()
          Method for initializing the language this agent know.
protected abstract  Ontology[] initializeOntologies()
          Method for initializing which ontologies this agent knows of.
protected  boolean knownLanguage(ACLMessage message)
          Method checking whether the used language is one that is known to the agent or not.
protected  boolean knownOntology(ACLMessage message)
          Method checking whether the used ontology is one that is known to the agent or not.
protected abstract  java.lang.String makeProposal(ACLMessage request)
          Method which will make a proposal to the given request.
protected abstract  ACLMessage performAction(ACLMessage request)
          Method specifying how to perform the action assigned
protected  void setCurrentRequest(ACLMessage request)
          Method for setting the current problem which this problem solving agent is about to solve.
protected  void setPartOfTeam(boolean pot)
          The method setPartOfTeam is called when the agent joins a team (set to true) and when the agent is finished joining a team (set to false).
 void setup()
          The setup method, set the initial properties of the CoPSProblemSolver- agent.
 
Methods inherited from class CoPS.agents.CoPSAgent
setServiceDescription
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoPSProblemSolver

public CoPSProblemSolver()
Method Detail

setup

public void setup()
The setup method, set the initial properties of the CoPSProblemSolver- agent. Modfied by Kari Roessland.


getLanguages

protected Codec[] getLanguages()

knownLanguage

protected boolean knownLanguage(ACLMessage message)
Method checking whether the used language is one that is known to the agent or not.

Parameters:
message - The message to check whether use a language known to the agent.
Returns:
boolean Returns true if the language is known to the agent and false otherwise.

initializeOntologies

protected abstract Ontology[] initializeOntologies()
Method for initializing which ontologies this agent knows of.

Returns:
Ontology[]

initializeLanguages

protected abstract Codec[] initializeLanguages()
Method for initializing the language this agent know.

Returns:
Codec The language

knownOntology

protected boolean knownOntology(ACLMessage message)
Method checking whether the used ontology is one that is known to the agent or not.

Parameters:
message - The message to check whether use a ontology known to the agent.
Returns:
boolean Returns true if the ontology is known to the agent and false otherwise.

deceideWhetherToMakeProposal

protected abstract boolean deceideWhetherToMakeProposal(ACLMessage request)
Method for deceiding whether to make a proposal or not.

Parameters:
request - The request which asks for a proposal
Returns:
boolean Returns true if a proposal is being made

makeProposal

protected abstract java.lang.String makeProposal(ACLMessage request)
Method which will make a proposal to the given request.

Parameters:
request - The request which the agent is to make a proposal for.
Returns:
String A text string which is being put inside the content slot of a proposal message.

setCurrentRequest

protected void setCurrentRequest(ACLMessage request)
Method for setting the current problem which this problem solving agent is about to solve.


getCurrentRequest

protected ACLMessage getCurrentRequest()
Method for getting the problem this agent has agreed to solve.

Returns:
String The current problem being solved.

getPartOfTeam

protected boolean getPartOfTeam()
The method getPartOfTeam returns true if the agent is part of a team and false if it is not. Added by Kari Roessland.

Returns:
boolean Whether the agent is part of a team (true) or not (false).

setPartOfTeam

protected void setPartOfTeam(boolean pot)
The method setPartOfTeam is called when the agent joins a team (set to true) and when the agent is finished joining a team (set to false). NB! An agent can only join one team at a time. Added by Kari Roessland.


performAction

protected abstract ACLMessage performAction(ACLMessage request)
Method specifying how to perform the action assigned

Parameters:
request - The request specifying the action requested
Returns:
ACLMessage The message specifying the solution