Agent System POND 1.0 (1.7.2000)

PkgAgentSystem.Experiences
Class Experiences

java.lang.Object
  |
  +--PkgAgentSystem.Experiences.Experiences

public class Experiences
extends Object
implements Serializable

The System for managing opinions on other agents. Stores the own opinion on oneself, the opinion on other agents and what the agents tell about each other.
See article for more.

Assumptions:

Version:
1.0, 1.7.2000
Author:
Michael Sonntag
See Also:
Serialized Form

Constructor Summary
Experiences(AgentIdentity self)
          Creates a new Experiences object for the agent with the provided identity.
 
Method Summary
 void addOwnOpinionOfOurself(String characteristic, double value)
          Sets the opinion of ourself on ourself (our own estimate how we do) concerning a characteristic.
 void addStatement(Statement stat)
          Adds a statement to the experience model.
 boolean createModel(AgentIdentity whom)
          Create an agent model for this agent.
 double createValue(AgentIdentity whom, String characteristic)
          Creates a model for the agent if it does not exist and creates the given key with its default value if this does not yet exist (Value: 0.0; Trust in this: 0.0).
 Enumeration getAgentModels()
          Retrieve an enumeration of all agent models.
 double getAverageTrust()
          Retrieve the average value of the general trust over all stored models.
 double getAverageValue(String characteristic)
          Retrieve the average value of a characteristic over all stored models.
protected  double getDefaultTrust(AgentIdentity whom)
          Returns the default level of trust in a certain agent.
 double getGeneralTrustOnAgent(AgentIdentity whom)
          Returns the general trust towards the given agent.
protected  double getOwnOpinionOfOurself(String characteristic)
          Retrieve the opinion of ourself on ourself (our own estimate how we do) concerning a characteristic.
 Vector[] getTraceLog()
          Retrieve the traces (identities and lines).
 double getTrustInValueOnAgent(AgentIdentity whom, String characteristic)
          Returns the trust in the value of the characteristic of the given agent.
 double getValueOnAgent(AgentIdentity whom, String characteristic)
          Returns the value of the characteristic of the given agent.
 void reset(AgentIdentity self)
          Resets this experiences model to the initial state.
 URL updateLocation(AgentIdentity identity, URL newLocation)
          Update the location for a certain agent.
 void writeTo(PrintWriter out)
          Writes all experiences to a stream.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Experiences

public Experiences(AgentIdentity self)
Creates a new Experiences object for the agent with the provided identity.
Parameters:
self - the identity of the owner of this experience model
Method Detail

reset

public void reset(AgentIdentity self)
Resets this experiences model to the initial state. Nothing is known on any agent and no statements are stored.
Parameters:
self - the identity of the owner of this experience model

updateLocation

public URL updateLocation(AgentIdentity identity,
                          URL newLocation)
Update the location for a certain agent.
Parameters:
identity - the identity of the agent whose location is to be updated
newLocation - the new location of the agent system at which the agent is believed to be
Returns:
the previously stored location of the agent

addOwnOpinionOfOurself

public void addOwnOpinionOfOurself(String characteristic,
                                   double value)
Sets the opinion of ourself on ourself (our own estimate how we do) concerning a characteristic. The trust in this characteristic is always 0.999 (we trust our own estimate fully).
Parameters:
characteristic - the characteristic of us we want to store our opinion of
value - the value of this characteristic of ourself

getOwnOpinionOfOurself

protected double getOwnOpinionOfOurself(String characteristic)
Retrieve the opinion of ourself on ourself (our own estimate how we do) concerning a characteristic. The trust in this characteristic is always 0.999 (we trust our own estimate fully).
Parameters:
characteristic - the characteristic of us we want to retrieve our opinion of
Returns:
the value of this characteristic of ourself

getDefaultTrust

protected double getDefaultTrust(AgentIdentity whom)
Returns the default level of trust in a certain agent. Will return 0.999 for ourself, less (0.8) for agents of the same owner (if certfiicates exists in both identites), even less (0.7) for the same owner without a certificate (only the name is/can be compared) or very little as default (0.1).
Parameters:
whom - the identity of the agent to evaluate
Returns:
the default trust for this agent

addStatement

public void addStatement(Statement stat)
Adds a statement to the experience model. Will lead to a recalculation if it is a new statement. If the telling agent or the agent it is on are not represented, AgentModel objects will be created for them.
Parameters:
stat - the statement to add

getGeneralTrustOnAgent

public double getGeneralTrustOnAgent(AgentIdentity whom)
Returns the general trust towards the given agent. The result is the general trust (if this does not exist the transitive trust). If the agent is unknown till now, creates a model fo the agent and returns the default value (therefore always between 0.0 and 1.0).
Parameters:
whom - identity of the agent
Returns:
the general trust towards this agent

getValueOnAgent

public double getValueOnAgent(AgentIdentity whom,
                              String characteristic)
Returns the value of the characteristic of the given agent. If unknown, returns the default value (therefore always between 0.0 and 1.0).
Parameters:
whom - identity of the agent
characteristic - the name of characteristic whose value is needed
Returns:
the value of the characteristic

getTrustInValueOnAgent

public double getTrustInValueOnAgent(AgentIdentity whom,
                                     String characteristic)
Returns the trust in the value of the characteristic of the given agent. If unknown, returns the default trust (therefore always between 0.0 and 1.0).
Parameters:
whom - identity of the agent
characteristic - the name of characteristic whose value is needed
Returns:
the trust in the value of the given characteristic

createModel

public boolean createModel(AgentIdentity whom)
Create an agent model for this agent. Will do nothing if one already exists.
Parameters:
whom - identity of the agent
Returns:
true if a model for this identity already existed

createValue

public double createValue(AgentIdentity whom,
                          String characteristic)
Creates a model for the agent if it does not exist and creates the given key with its default value if this does not yet exist (Value: 0.0; Trust in this: 0.0).
Parameters:
whom - identity of the agent
characteristic - the characteristic to create
Returns:
the previously existing value of this characteristic or negative if newly created

writeTo

public void writeTo(PrintWriter out)
Writes all experiences to a stream. Used for testing.
Parameters:
out - the stream to write to

getAgentModels

public Enumeration getAgentModels()
Retrieve an enumeration of all agent models. Necessary only for testing. See class ExperienceTest.
Returns:
an enumeration of all agent models

getAverageValue

public double getAverageValue(String characteristic)
Retrieve the average value of a characteristic over all stored models. Used for testing.
Parameters:
characteristic - the characteristic to get the statistic for
Returns:
the average value of the characteristic or -1.0d if no valid values found

getAverageTrust

public double getAverageTrust()
Retrieve the average value of the general trust over all stored models. Used for testing.
Returns:
the average value of the general trust or -1.0d if no valid values found

getTraceLog

public Vector[] getTraceLog()
Retrieve the traces (identities and lines).
Returns:
array of vectors: [0]=identities, [1]=lines or null if tracing is not enabled

Agent System POND 1.0 (1.7.2000)

Submit a bug

Copyright 2000 Michael Sonntag & Institute for Information Processing and Microprocessor Technology (FIM), Johannes-Kepler-University Linz, Altenbergerstr. 69, A-4040 Linz, Austria.