|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--AgentsPopulations
This is the class where the population of agents are initialized. It is also here that the main loop of each experiment is located. In addition, various computations for graphs analysis are carried out here.
| Field Summary | |
private Agent[] |
agentSet
The list of agents |
private java.util.Vector |
agSet
The created agents list for purpose of communication |
double |
averClique
Average cliquishness in the Agents population, for each problem |
int |
communication
Communication between agents is allowed (=1) or not (=0) |
private static XCSConstants |
cons
Stores the relevant constants for XCS. |
double |
consultRatio
Percentage of the population to be consulted by the agents |
double |
coreCompetence
Competence range of the agents (determines their core specialisations) |
Environment |
env
Stores the posed problem. |
private int |
maxProblems
Specifies the number of exploration problems/trials to solve in one experiment by one agent. |
private int |
nrExps
Specifies the number of investigated experiments for each agent. |
(package private) int[] |
orderAgentsTable
The order in which agents receive the problem |
(package private) java.lang.String |
orgaType
Type of the organization studied m= manager c= community |
int |
payoffType
Structure of the reward function in the environment |
(package private) double |
performance
Performance one agent gains in answering a signal from the problem space |
private double |
performanceCP
the cumulated performance of the system |
java.lang.String |
problemType
The type of the environment, i.e. the problem space |
(package private) java.io.PrintWriter |
pwCP
The output file |
(package private) java.util.Random |
R
Random generator |
(package private) int |
run
Number of runs of the total simulation |
(package private) double |
saveProb
Probabilities for data to be saved for statistical treatment |
int |
selectorAgent
Selection in the PredictionArray for each Agent: 1: bestActionWinner 0: rouletteActionWinner |
int |
totalCommunications
The total number of communications in the population for each problem. |
private static int |
totalNumberOfAgents
the number of agents constituting the population |
private static AgentsPopulations |
wholePopulation
The total population of agents |
| Constructor Summary | |
AgentsPopulations(int nbAgents,
double competence,
double consultRatio0,
int selectAgent0,
int communicate,
int payoffType0,
java.lang.String problem,
int run0,
double saveProb0,
java.io.PrintWriter pwCP0,
int maxProblems0)
Constructor for the initial organisation |
|
| Method Summary | |
private void |
affiche(int[][] matrix,
java.io.PrintWriter pW1)
Prints the matrix of relationships into the outfile |
private int[][] |
buildRelationships(int[][] mat)
Constructs the matrix of the relationships between agents stored in the out file at the end of each experiment |
private double |
computeCliquishness(int[][] mat)
Computes the average cliquishness of the graph derived from the matrix of relationships |
private double |
computePerformance(double[] perfArray)
Computes the average performance of the population of agents based on the performance of the responding agents at each signal. |
private int |
computeSize(int[] neighborhood)
Computes the size of the neignborhood of an agent |
private int |
countEdges(int[][] mat,
int[] clus,
int size)
Count the number of links existing between the agents belonging to the same neignborhood |
(package private) void |
doOneSingleStepExperiment()
Executes one single-step experiment. |
Agent[] |
getAgentSet()
return the population of agents considered |
java.util.Vector |
getSet()
return the population of agents considered during a communication process |
private int[] |
listNeighbors(int[][] mat,
int[] neighborhood,
int i)
Builds the list of first neighbors of an agent. |
void |
run()
The loop where the population of agents is generated and the experiment is launched |
void |
runExperiment(Environment envt)
Runs the posed problem with XCS. |
void |
setNumberOfExperiments(int exps)
Resets the number of experiments for each agent. |
void |
setNumberOfTrials(int trials)
Resets the maximal number of trials in one experiment for an agent. |
private void |
shakeAgentsOrder(int nbAgents)
Method used to build at each experiment a random list. |
private void |
startExperiments()
This function runs the number of experiments specified. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private int maxProblems
private int nrExps
private static AgentsPopulations wholePopulation
private static int totalNumberOfAgents
private double performanceCP
private Agent[] agentSet
private java.util.Vector agSet
public Environment env
private static XCSConstants cons
XCSConstantspublic int communication
public double coreCompetence
public double consultRatio
public int selectorAgent
public int payoffType
public java.lang.String problemType
public int totalCommunications
public double averClique
double performance
int run
java.lang.String orgaType
java.io.PrintWriter pwCP
int[] orderAgentsTable
double saveProb
java.util.Random R
| Constructor Detail |
public AgentsPopulations(int nbAgents,
double competence,
double consultRatio0,
int selectAgent0,
int communicate,
int payoffType0,
java.lang.String problem,
int run0,
double saveProb0,
java.io.PrintWriter pwCP0,
int maxProblems0)
nbAgents - Number of Agents (except manager) used in the experimentscompetence - Size of the domain of specialisation of agentsconsultRatio0 - Percentage of agents' population that is asked at randomselectAgent0 - Mode of rule selection used by agentscommunicate - Whether (1) or not (0) communication among agents is allowedpayoffType0 - Structure of the reward function of the environmentproblem - The type of problem spacerun0 - Number of runssaveProb0 - Probability of data to be savedpwCP0 - Name of the first file where results are storedmaxProblems0 - Number of experiments in one run| Method Detail |
public void run()
public Agent[] getAgentSet()
public java.util.Vector getSet()
public void setNumberOfTrials(int trials)
trials - The number of problems submitted to agents during one experimentpublic void setNumberOfExperiments(int exps)
exps - The number of experimentspublic void runExperiment(Environment envt)
envt - The problem spacestartExperiments()private void startExperiments()
Agent.Agent(double,double),
Book#Book(int, int),
XClassifierSet.XClassifierSet(int, int),
Agent.setAddressBook(Book),
Agent.setXClassifierSet(XClassifierSet),
Agent.setName(int),
doOneSingleStepExperiment()void doOneSingleStepExperiment()
Square.resetState(),
Agent.doOneSingleStepProblemExplore(String, int, AgentsPopulations, int),
buildRelationships(int[][]),
affiche(int[][], PrintWriter),
computeCliquishness(int[][]),
computePerformance(double[]),
XClassifierSet.printCharacteristics(PrintWriter)private int[][] buildRelationships(int[][] mat)
mat - the matrix initialized with 0s
private void affiche(int[][] matrix,
java.io.PrintWriter pW1)
matrix - The matrix of relationshipspW1 - The output fileprivate double computeCliquishness(int[][] mat)
mat - the matrix of links (or edges)#listNeighbors(int[][],int,int),
#computeSize(int),
#countEdges(int[][],int,int)
private int[] listNeighbors(int[][] mat,
int[] neighborhood,
int i)
mat - the matrix of relationshipsneighborhood - the initialized neighborhood with all values set to -1i - the agent of which we seek the neighborhoodprivate int computeSize(int[] neighborhood)
neighborhood - The list of first neignbors of the agent considered
private int countEdges(int[][] mat,
int[] clus,
int size)
mat - The matrix of relationshipsclus - The list of first neighbors consideredsize - The number of neighbors in the neignborhood consideredprivate double computePerformance(double[] perfArray)
perfArray - The array storing the performance of agentsprivate void shakeAgentsOrder(int nbAgents)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||