|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.cfpm.caves.za.EndorsementScheme
public class EndorsementScheme
This class represents an endorsement scheme of an agent. This is basically a table of endorsement tokens ("labels") and their associated weights ("values"). It allows the agent to evaluate another agent by computing the overall endorsement value of all endorsements he has made to that agent.
Field Summary | |
---|---|
(package private) double |
base
the base of the endorsement scheme, used in the calculation of the overall endorsement value |
(package private) jess.Value |
name
the name of the endorsement scheme |
(package private) java.util.HashMap<jess.Value,java.lang.Integer> |
scheme
the actual scheme = table of tokens and weights |
Constructor Summary | |
---|---|
EndorsementScheme(java.lang.String name,
double base)
Creates a new endorsement scheme with the given name and base |
|
EndorsementScheme(jess.Value name,
double base)
Creates a new endorsement scheme with the given name and base |
Method Summary | |
---|---|
void |
addEndorsement(jess.Value token,
int value)
adds an endorsement (pair of token and weight value) |
double |
calculateEndorsementValue(jess.ValueVector endorsements)
calculates the overall endorsement value for the given list of endorsement tokens, using the formula from Moss (1995). |
jess.Value[] |
getEndorsementsList()
returns the list of endorsement tokens |
jess.Value |
getName()
returns the name of the endorsement scheme |
int |
getValue(jess.Value endorsement)
returns the weight associated with the given endorsement token |
void |
print()
prints the endorsement scheme (table of tokens and values) to console |
void |
setName(java.lang.String nameString)
sets the name of the endorsement scheme |
void |
setName(jess.Value name)
sets the name of the endorsement scheme |
java.lang.String |
toString()
returns a String representation of the endorsement scheme |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
jess.Value name
double base
java.util.HashMap<jess.Value,java.lang.Integer> scheme
Constructor Detail |
---|
public EndorsementScheme(java.lang.String name, double base)
name
- the scheme's name as Stringbase
- the scheme's basepublic EndorsementScheme(jess.Value name, double base)
name
- the scheme's namebase
- the scheme's baseMethod Detail |
---|
public void addEndorsement(jess.Value token, int value)
token
- the endorsement tokenvalue
- the weight to be associated with the tokenpublic double calculateEndorsementValue(jess.ValueVector endorsements)
endorsements
- list of endorsement tokens
public jess.Value getName()
public void setName(jess.Value name)
name
- the namepublic void setName(java.lang.String nameString)
nameString
- the name as Stringpublic jess.Value[] getEndorsementsList()
public java.lang.String toString()
toString
in class java.lang.Object
public void print()
public int getValue(jess.Value endorsement)
endorsement
- endorsement token
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |