|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--PkgAgentSystem.Experiences.AgentModel
Represents a single agent in the experiences model. Stores references to all statements this agent made and which were made about this agent. Also includes our general trust in the agent and the last location we knew/heard of this agent. Most important, our own opinion on all characteristics of this agent are stored here also.
Experiences
, Serialized FormField Summary | |
(package private) boolean |
changed
Used for the internal recalculation of trust. |
Constructor Summary | |
AgentModel(AgentIdentity identity)
Creates a new model for the agent whose identity is provided as parameter. |
|
AgentModel(AgentIdentity identity,
double initialTrust,
URL location)
Creates a new model for the agent whose identity is provided as parameter. |
Method Summary | |
void |
addOnAgentStatement(Statement stat)
Add a statement from this agent on another one. |
void |
addSourceStatement(Statement stat)
Add a statement from another agent on this one. |
URL |
currentLocation()
Retrieve the location, where this agent is currently expected to be (might be wrong). |
boolean |
equals(Object obj)
Compares two agent models for equality by comparing the identity of the contained agent. |
String[] |
getCharacteristicsListSource()
Retrieve a list of all characteristics for which we have statements on this agent. |
double |
getGeneralTrust()
Retrieve the general trust we set in the agent with this identity. |
AgentIdentity |
getIdentity()
Retrieve the identity of the agent this object represents |
Statement |
getOnAgentStatement(AgentIdentity onAgent,
String characteristic)
Retrieve the last statement of the given characteristic, which this agent made on the given agent. |
StatementEnumeration |
getOnAgentStatements(String filter)
Retrieve an enumeration of all statements this agent made on others concerning a certain characteristic. |
Statement |
getSourceStatement(AgentIdentity source,
String characteristic)
Retrieve the last statement of the given characteristic, which was made on this agent by the given source. |
StatementEnumeration |
getSourceStatements(String filter)
Retrieve an enumeration of all statements on this agent made by others concerning a certain characteristic. |
double |
getTransitiveTrust()
Retrieve the transitive trust we set in the agent with this identity. |
double |
getTrustInValue(String characteristic)
Retrieve the trust we have in our own opinion on a characteristic of this agent. |
double |
getValue(String characteristic)
Retrieve our own opinion on a characteristic of this agent. |
int |
hashCode()
Returns a hash code value for the object. |
boolean |
isTransitiveOnly()
Returns true if we only have a transitive but no general trust towards this agent. |
protected void |
setGeneralTrust(double newTrust)
Sets the general trust towards this agent. |
protected void |
setTransitiveTrust(double newTransitiveTrust)
Sets the transitive trust towards this agent. |
void |
setValue(String characteristic,
double value,
double trustInValue)
Store the value of our opinion and the trust in it of a given characteristic of this agent. |
String |
toString()
Retrieve a string representation of this object. |
URL |
updateLocation(URL newLocation)
Update the location, where this agent is currently expected to be. |
void |
writeTo(PrintWriter out)
Writes this model to a stream. |
Methods inherited from class java.lang.Object |
|
Field Detail |
boolean changed
Constructor Detail |
public AgentModel(AgentIdentity identity)
identity
- of the agent to representpublic AgentModel(AgentIdentity identity, double initialTrust, URL location)
identity
- of the agent to representinitialTrust
- the initial value for the general trust in this agent (must be in range 0.0 - 1.0)location
- the current location of this agent (may be null
)Method Detail |
public double getGeneralTrust()
public double getTransitiveTrust()
public boolean isTransitiveOnly()
true
if we only have a transitive but no general trust towards this agent.true
if only transitive trust existsprotected void setGeneralTrust(double newTrust)
newTrust
- the new general trust towards the agent with this identityprotected void setTransitiveTrust(double newTransitiveTrust)
newTransitiveTrust
- the new transitive trust towards the agent with this identitypublic AgentIdentity getIdentity()
public URL currentLocation()
URL
of the agent system where we last knew/heard the agent to bepublic URL updateLocation(URL newLocation)
URL
- of the agent system where we now believe the agent to be (may be null
if we know it is no longer at this location but know not where it is now)URL
of the agent system where we last knew/heard the agent to bepublic void addSourceStatement(Statement stat)
the
- statement on this agentpublic void addOnAgentStatement(Statement stat)
the
- statement by this agentpublic Statement getSourceStatement(AgentIdentity source, String characteristic)
source
- the agent, whichs statement on this agent we want to retrievecharacteristic
- the characteristic the statement is aboutpublic Statement getOnAgentStatement(AgentIdentity onAgent, String characteristic)
onAgent
- the agent, on which the statement by this agent was madecharacteristic
- the characteristic the statement is aboutpublic StatementEnumeration getSourceStatements(String filter)
filter
- the characteristic we which to retrieve statements aboutpublic StatementEnumeration getOnAgentStatements(String filter)
filter
- the characteristic we which to retrieve statements aboutpublic double getValue(String characteristic)
characteristic
- the characteristic, we want to know the opinion we have onpublic double getTrustInValue(String characteristic)
characteristic
- the characteristic, we want to know the trust we have in our opinionpublic void setValue(String characteristic, double value, double trustInValue)
characteristic
- the characteristic we want to store our opinion aboutvalue
- our opinion of this characteristic of this agenttrustInValue
- the trust in our own opinion about this agent concerning the characteristicpublic String[] getCharacteristicsListSource()
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
obj
- the reference object with which to comparetrue
if this model contains the same identity as the obj argument; false
otherwisepublic void writeTo(PrintWriter out)
out
- the stream to dump this object to
|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |