public class Context extends AbstractContext implements java.io.Serializable
Constructor and Description |
---|
Context(Context c)
Instantiates a new context.
|
Context(World world,
Head head)
The main constructor, used by AMOEBA to build new context agent.
|
Context(World world,
Head controller,
java.util.HashMap<java.lang.String,java.lang.Double> mins,
java.util.HashMap<java.lang.String,java.lang.Double> maxs,
java.util.HashMap<java.lang.String,java.lang.Double> exps,
double experimentValue,
java.lang.String contextName)
Instantiates a new context.
|
Modifier and Type | Method and Description |
---|---|
void |
analyzeResults(Head ctrl)
Analyze results.
|
void |
computeAMessage(Message m)
Compute A message.
|
boolean |
computeValidity()
Compute validity.
|
void |
die()
Remove all the references in other agents and remove the agent from the
scheduler.
|
double |
getAction()
Gets the action.
|
double |
getActionProposal()
Gets the action proposal.
|
double |
getConfidence()
Gets the confidence.
|
Head |
getControler()
Gets the controler.
|
java.util.ArrayList<Experiment> |
getExperiments()
Gets the experiments.
|
LocalModelAgent |
getFunction()
Gets the function.
|
int |
getNSelection()
Gets the n selection.
|
java.util.HashMap<Percept,Range> |
getRanges()
Gets the ranges.
|
java.util.ArrayList<? extends Agent> |
getTargets()
Gets the targets.
|
java.lang.Double |
getValueActionProposition()
Gets the value action proposition.
|
void |
growRanges(Head head)
Grow every ranges allowing to includes current situation.
|
void |
init()
Inits the.
|
boolean |
isBestContext()
Checks if is best context.
|
boolean |
isFirstTimePeriod()
Checks if is first time period.
|
boolean |
isValid()
Checks if is valid.
|
void |
play()
Play one agent step.
|
void |
playEndCycle()
Play end cycle.
|
void |
setAction(double action)
Sets the action.
|
void |
setBestContext(boolean bestContext)
Sets the best context.
|
void |
setConfidence(double confidence)
Sets the confidence.
|
void |
setControler(Head controler)
Sets the controler.
|
void |
setExperiments(java.util.ArrayList<Experiment> experiments)
Sets the experiments.
|
void |
setFirstTimePeriod(boolean firstTimePeriod)
Sets the first time period.
|
void |
setFunction(LocalModelAgent function)
Sets the function.
|
void |
setnSelection(int nSelection)
Sets the n selection.
|
void |
setRanges(java.util.HashMap<Percept,Range> ranges)
Sets the ranges.
|
void |
setValid(boolean valid)
Sets the valid.
|
void |
shrinkRanges(Head head)
Shrink one range in order to exclude current situation.
|
void |
shrinkRangesToJoinBorders(Head head,
Context c)
Shrink ranges to join borders.
|
void |
solveNCS_Concurrence(Head head)
Solve NC S concurrence.
|
void |
solveNCS_IncompetentHead(Head head)
Solve NC S incompetent head.
|
java.lang.String |
toString() |
getWorld, setWorld
getID, getMessages, getMessagesBin, getName, isDying, readMessage, sendExpressMessage, sendMessage, sendMessage, setDying, setID, setMessages, setMessagesBin, setName
public Context(World world, Head head)
world
- : the world where the agent must live.head
- : the head agent associated with the next context agentpublic Context(World world, Head controller, java.util.HashMap<java.lang.String,java.lang.Double> mins, java.util.HashMap<java.lang.String,java.lang.Double> maxs, java.util.HashMap<java.lang.String,java.lang.Double> exps, double experimentValue, java.lang.String contextName)
world
- the worldcontroller
- the controllermins
- the minsmaxs
- the maxsexps
- the expsexperimentValue
- the experiment valuecontextName
- the context namepublic Context(Context c)
c
- the cpublic java.lang.Double getValueActionProposition()
public void computeAMessage(Message m)
Agent
computeAMessage
in class AbstractContext
m
- the mpublic void play()
Agent
play
in class SystemAgent
public void solveNCS_IncompetentHead(Head head)
head
- the headpublic void solveNCS_Concurrence(Head head)
head
- the headpublic double getActionProposal()
public boolean computeValidity()
public void setRanges(java.util.HashMap<Percept,Range> ranges)
ranges
- the rangespublic Head getControler()
public void setControler(Head controler)
controler
- the new controlerpublic double getAction()
public void setAction(double action)
action
- the new actionpublic java.util.ArrayList<? extends Agent> getTargets()
SystemAgent
getTargets
in class AbstractContext
public void init()
public java.lang.String toString()
toString
in class java.lang.Object
public int getNSelection()
public void setnSelection(int nSelection)
nSelection
- the new n selectionpublic boolean isValid()
public void setValid(boolean valid)
valid
- the new validpublic boolean isFirstTimePeriod()
public void setFirstTimePeriod(boolean firstTimePeriod)
firstTimePeriod
- the new first time periodpublic boolean isBestContext()
public void setBestContext(boolean bestContext)
bestContext
- the new best contextpublic LocalModelAgent getFunction()
public void setFunction(LocalModelAgent function)
function
- the new functionpublic java.util.ArrayList<Experiment> getExperiments()
public void setExperiments(java.util.ArrayList<Experiment> experiments)
experiments
- the new experimentspublic double getConfidence()
public void setConfidence(double confidence)
confidence
- the new confidencepublic void playEndCycle()
public void analyzeResults(Head ctrl)
ctrl
- the ctrlpublic void growRanges(Head head)
head
- the headpublic void shrinkRanges(Head head)
head
- the headpublic void shrinkRangesToJoinBorders(Head head, Context c)
head
- the headc
- the cpublic void die()
AbstractContext
die
in class AbstractContext