|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectAgArch
jmadem.MADeMAgArch
public class MADeMAgArch
Basic architecture for a Jason agent performing MADeM decisions.
Nested Class Summary | |
---|---|
(package private) class |
MADeMAgArch.BidTimeout
Handles bid timeout for a specific decision making. |
Field Summary | |
---|---|
private java.lang.String |
agName
Agent name |
private boolean |
automaticRemoveOfMademData
Flag indicating whether to remove the data managed by MADeM after the winner determination problem. |
private java.util.logging.Logger |
logger
Class logger |
private java.util.concurrent.ConcurrentMap<java.lang.Integer,DecisionData> |
mademData
Data managed by MADeM for every decision being performed: id_decision, agents involved, allocations, utility functions considered, bids... |
private java.util.concurrent.ConcurrentMap<Atom,java.lang.Float> |
personalWeights
Personal weights representing the internal attitude of the agent towards other individuals. |
private java.util.Random |
random
Random numbers generator |
private java.util.concurrent.ScheduledExecutorService |
timeoutScheduler
Pool of threads to schedule timeouts |
private int |
tout
Maximum waiting time for bids (in milliseconds). |
private java.util.concurrent.ConcurrentMap<Atom,UtilityFunctionInt> |
utilityFunctions
Utility functions repository |
private java.util.concurrent.ConcurrentMap<ListTerm,java.util.List<Term>> |
utilityValues
Storage devoted to hold utility values while they are calculated. |
private java.util.concurrent.ConcurrentMap<Atom,java.lang.Float> |
utilityWeights
Utility weights representing the importance given to each point of view in the multi-modal agent decision making. |
private Cuf |
welfare
Social welfare considered by the agent |
Constructor Summary | |
---|---|
MADeMAgArch()
|
Method Summary | |
---|---|
boolean |
addUtilityFunction(Atom uFuncName,
java.lang.String uFuncClass)
Registers a new utility function in the MADeM agent. |
private void |
bid(ListTerm utilityKey)
Bids over a set of allocations coming from an auctioneer. |
void |
catchUtilityValue(ListTerm utilityKey,
Term utilityValue)
Catches a utility value coming from an AgentSpeak plan and stores it within the utility values storage. |
void |
checkMail()
Filters MADeM messages out of the agent Mailbox. |
private void |
computeUtilities(java.lang.String auctioneer,
Literal madem_auction)
Computes the utility of a set of allocations coming from an auctioneer according to the specified utility functions. |
float |
getPersonalWeight(Atom agName)
Gets the personal weight of the MADeM agent towards another agent. |
java.util.concurrent.ConcurrentMap<Atom,java.lang.Float> |
getPersonalWeights()
Gets the personal weights of the MADeM agent. |
int |
getTimeout()
Gets bid timeout (in milliseconds). |
private float |
getUtility(java.lang.String auctioneer,
Term allocation,
UtilityFunctionInt utilityFunction)
Obtains the utility value given by a specific utility function. |
java.util.Set<Atom> |
getUtilityFunctionNames()
Gets the names of the utility functions previously registered in the MADeM agent. |
float |
getUtilityWeight(Atom utilityName)
Gets the weight of the MADeM agent for a certain utility function. |
java.util.concurrent.ConcurrentMap<Atom,java.lang.Float> |
getUtilityWeights()
Gets the utility weights of the MADeM agent. |
java.lang.String |
getWelfare()
Gets the social welfare of the MADeM agent. |
void |
initAg(java.lang.String agClass,
ClassParameters bbPars,
java.lang.String asSrc,
Settings stts)
MADeM agent initiator. |
boolean |
isAutomaticRemoveOfMademData()
Gets the value of the automatic remove of MADeM data flag. |
private void |
processBid(java.lang.String bidder,
Literal madem_bid)
Process an external bid related to a certain decision. |
boolean |
removeUtilityFunction(Atom uFuncName)
Removes a utility function previously registered in the MADeM agent. |
void |
setAutomaticRemoveOfMademData(boolean automaticRemoveOfMademData)
Sets the value of the flag indicating whether to remove the data managed by MADeM after the winner determination problem. |
boolean |
setPersonalWeight(Atom agName,
java.lang.Float new_pw)
Changes the personal weight of the MADeM agent towards another agent. |
boolean |
setPersonalWeights(java.util.concurrent.ConcurrentMap<Atom,java.lang.Float> new_pw)
Changes the personal weights of the MADeM agent towards the other agents. |
boolean |
setTimeout(int new_tout)
Changes bid timeout to a new positive value. |
boolean |
setUtilityWeight(Atom utilityName,
java.lang.Float new_uw)
Changes the utility weight of the MADeM agent for a certain utility function. |
boolean |
setUtilityWeights(java.util.concurrent.ConcurrentMap<Atom,java.lang.Float> new_uw)
Changes the utility weights of the MADeM agent. |
void |
setWelfare(Cuf new_sw)
Changes social welfare of the MADeM agent. |
int |
startMADeMDecision(ListTerm ags,
ListTerm allocs,
ListTerm uFuncs,
boolean multipleSolutions)
Starts a MADeM decision using the internal parameters of the agent. |
int |
startMADeMDecision(ListTerm ags,
ListTerm allocs,
ListTerm uFuncs,
java.util.concurrent.ConcurrentMap<Atom,java.lang.Float> pW,
java.util.concurrent.ConcurrentMap<Atom,java.lang.Float> uW,
Cuf sw,
int tout,
boolean multipleSolutions)
Starts a MADeM decision by specifying all its parameters. |
private void |
winnerDeterminationProblem(int id_decision)
Solves the winner determination problem for a specific decision. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.logging.Logger logger
private java.util.Random random
private java.lang.String agName
private java.util.concurrent.ConcurrentMap<Atom,UtilityFunctionInt> utilityFunctions
private java.util.concurrent.ConcurrentMap<Atom,java.lang.Float> utilityWeights
private java.util.concurrent.ConcurrentMap<Atom,java.lang.Float> personalWeights
private Cuf welfare
private int tout
private java.util.concurrent.ScheduledExecutorService timeoutScheduler
private java.util.concurrent.ConcurrentMap<java.lang.Integer,DecisionData> mademData
private boolean automaticRemoveOfMademData
private java.util.concurrent.ConcurrentMap<ListTerm,java.util.List<Term>> utilityValues
Constructor Detail |
---|
public MADeMAgArch()
Method Detail |
---|
public void initAg(java.lang.String agClass, ClassParameters bbPars, java.lang.String asSrc, Settings stts) throws JasonException
agClass
- agent class definitionbbPars
- agent class parametersasSrc
- AgentSpeak source codestts
- MAS Runtime Settings for an Agent
JasonException
public void setAutomaticRemoveOfMademData(boolean automaticRemoveOfMademData)
automaticRemoveOfMademData
- true if the MADeM data has to be removed after the Winner Determination Problem, false otherwisepublic boolean isAutomaticRemoveOfMademData()
public boolean addUtilityFunction(Atom uFuncName, java.lang.String uFuncClass)
uFuncName
- name of the utility function to be addeduFuncClass
- name of the class implementing the utility function
public boolean removeUtilityFunction(Atom uFuncName)
uFuncName
- name of the utility function to be removed
public java.util.Set<Atom> getUtilityFunctionNames()
public int startMADeMDecision(ListTerm ags, ListTerm allocs, ListTerm uFuncs, boolean multipleSolutions)
ags
- names of the agents involved in the decisionallocs
- allocations being considered as solutions for the decision problemuFuncs
- names of the different utility functions to pay attention tomultipleSolutions
- ask for all possible winners or just one randomly chosen
public int startMADeMDecision(ListTerm ags, ListTerm allocs, ListTerm uFuncs, java.util.concurrent.ConcurrentMap<Atom,java.lang.Float> pW, java.util.concurrent.ConcurrentMap<Atom,java.lang.Float> uW, Cuf sw, int tout, boolean multipleSolutions)
ags
- names of the agents involved in the decisionallocs
- allocations being considered as solutions for the decision problemuFuncs
- names of the different utility functions to pay attention topW
- personal weights to be applied over external preferencesuW
- utility weights in the multi-modal decisionsw
- type of social welfare being consideredtout
- timeout for getting bids (in milliseconds)multipleSolutions
- ask for all possible winners or just one randomly chosen
public void checkMail()
public boolean setTimeout(int new_tout)
new_tout
- new timeout value (in milliseconds)
public int getTimeout()
public void setWelfare(Cuf new_sw)
new_sw
- new social welfarepublic java.lang.String getWelfare()
public boolean setPersonalWeight(Atom agName, java.lang.Float new_pw)
agName
- name of the agentnew_pw
- new personal weights
public float getPersonalWeight(Atom agName)
agName
- name of the agent
public boolean setPersonalWeights(java.util.concurrent.ConcurrentMap<Atom,java.lang.Float> new_pw)
new_pw
- new personal weights
public java.util.concurrent.ConcurrentMap<Atom,java.lang.Float> getPersonalWeights()
public float getUtilityWeight(Atom utilityName)
utilityName
- name of the utility function
public boolean setUtilityWeight(Atom utilityName, java.lang.Float new_uw)
utilityName
- name of the utility functionnew_uw
- new utility weights
public boolean setUtilityWeights(java.util.concurrent.ConcurrentMap<Atom,java.lang.Float> new_uw)
new_uw
- new utility weights
public java.util.concurrent.ConcurrentMap<Atom,java.lang.Float> getUtilityWeights()
private void computeUtilities(java.lang.String auctioneer, Literal madem_auction)
auctioneer
- agent asking for preferencemadem_auction
- allocations and utility functions being consideredpublic void catchUtilityValue(ListTerm utilityKey, Term utilityValue)
utilityKey
- identifier of the utility value being caughtutilityValue
- utility valueprivate void bid(ListTerm utilityKey)
utilityKey
- identifier of the utility values storageprivate void processBid(java.lang.String bidder, Literal madem_bid)
bidder
- name of the agent who sent the bidmadem_bid
- bid containing bidder's preferencesprivate float getUtility(java.lang.String auctioneer, Term allocation, UtilityFunctionInt utilityFunction)
auctioneer
- agent asking for preferenceallocation
- allocation being evaluatedutilityFunction
- utility function being considered
private void winnerDeterminationProblem(int id_decision)
id_decision
- Identifier of the decision being solved
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |