|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ocopomo.drams.modelling.Agent
org.ocopomo.endorsement.EndorserAgent
public abstract class EndorserAgent
This abstract class contains methods useful for the management of the endorsements: agent-classes that need to use endorsements should extend this class.
Constructor Summary | |
---|---|
EndorserAgent(java.lang.String name,
EndorserModel model)
|
Method Summary | |
---|---|
void |
addEndorsementFact(org.ocopomo.drams.modelling.Agent endorsee,
java.lang.String endorsement,
EndorsementScheme scheme)
Add a new endorsement to the agent's fact base using the current tick. |
void |
addEndorsementFact(org.ocopomo.drams.modelling.Agent endorsee,
java.lang.String endorsement,
EndorsementScheme scheme,
double tick)
Add a new endorsement to the agent's fact base using the specified tick. |
void |
addEndorsementScheme(java.lang.String schemeName,
EndorsementScheme scheme)
|
int |
doubleToInt(double val)
In DRAMS the evaluation of a math expression returns a double. |
java.lang.Double |
endorsementsValue(java.lang.Object[] endorsements,
java.lang.String schemeName)
Returns a double that represents the evaluation of the ArrayList of endorsement-Objects in input in relation to the endorsement scheme named schemeName. |
java.lang.Double |
endorsementsValue(java.lang.String[] endorsements,
java.lang.String schemeName)
Returns a double that represents the evaluation of the array of endorsements in input in relation to the endorsement scheme named schemeName. |
void |
generateRandomEndorsement(org.ocopomo.drams.modelling.Agent agent,
EndorsementScheme scheme)
Adds to this agent's fact base a random endorsement chosen inside the scheme given in input relative to the endorsee agent |
void |
generateRandomEndorsement(java.lang.String schemeName,
org.ocopomo.drams.modelling.Agent endorsee)
Adds to this agent's fact base a random endorsement chosen inside the scheme given in input relative to the endorsee agent |
void |
generateRandomEndorsements(java.util.ArrayList<? extends org.ocopomo.drams.modelling.Agent> researchCentreList,
java.lang.String schemeName)
Generate random endorsements relative to an endorsement scheme for the agents given in input. |
EndorsementScheme |
getEndorsementScheme(java.lang.String endSchemeName)
Search for the endorsement scheme named endSchemeName inside the endorsement dictionary |
int |
nextInt(int val)
In DRAMS the evaluation of a math expression returns a double. |
static java.util.ArrayList<? extends org.ocopomo.drams.modelling.Agent> |
selectRandomAgents(java.util.ArrayList<? extends org.ocopomo.drams.modelling.Agent> agentList)
|
void |
setBeneconModel(EndorserModel m)
|
Methods inherited from class org.ocopomo.drams.modelling.Agent |
---|
getFactBase, getName, getRuleBase |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EndorserAgent(java.lang.String name, EndorserModel model)
Method Detail |
---|
public void addEndorsementScheme(java.lang.String schemeName, EndorsementScheme scheme)
public void setBeneconModel(EndorserModel m)
public void addEndorsementFact(org.ocopomo.drams.modelling.Agent endorsee, java.lang.String endorsement, EndorsementScheme scheme)
endorsee
- The endorsee of the new endorsementendorsement
- The new endorsement (token-value inside the endorsement scheme) to be addedscheme
- The scheme to be used to evaluate the new endorsementpublic void addEndorsementFact(org.ocopomo.drams.modelling.Agent endorsee, java.lang.String endorsement, EndorsementScheme scheme, double tick)
endorsee
- The endorsee of the new endorsementendorsement
- The new endorsement (token-value inside the endorsement scheme) to be addedscheme
- The scheme to be used to evaluate the new endorsementtick
- The tick to be used for the new endorsement factpublic void generateRandomEndorsement(org.ocopomo.drams.modelling.Agent agent, EndorsementScheme scheme) throws java.lang.Exception
agent
- The endorsee of the endorsementscheme
- The scheme within which the endorsement token has to be choosen
java.lang.Exception
- A generic exception caused by wrong arguments passingpublic void generateRandomEndorsement(java.lang.String schemeName, org.ocopomo.drams.modelling.Agent endorsee)
agent
- The endorsee of the endorsementscheme
- The name of the scheme within which the endorsement token has to be chosen
java.lang.Exception
- A generic exception caused by wrong arguments passingpublic static java.util.ArrayList<? extends org.ocopomo.drams.modelling.Agent> selectRandomAgents(java.util.ArrayList<? extends org.ocopomo.drams.modelling.Agent> agentList)
public void generateRandomEndorsements(java.util.ArrayList<? extends org.ocopomo.drams.modelling.Agent> researchCentreList, java.lang.String schemeName)
researchCentreList
- A list containing the agent for wich to generate random endorsementsschemeName
- The name of the scheme to use. the endorsements are generated randomly among the endorsements
contained inside this scheme.public java.lang.Double endorsementsValue(java.lang.String[] endorsements, java.lang.String schemeName)
endorsements
- An array containing the name of the endorsementsschemeName
- The name of the endorsement scheme
public java.lang.Double endorsementsValue(java.lang.Object[] endorsements, java.lang.String schemeName)
endorsements
- An array of Objects containing the name of the endorsementsschemeName
- The name of the endorsement scheme
public EndorsementScheme getEndorsementScheme(java.lang.String endSchemeName)
endSchemeName
- the name of the scheme
public int nextInt(int val)
val
-
public int doubleToInt(double val)
val
- The double to be converted
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |