|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--AgentsPopulations
Title : communities of practice Description : Model emergence of communities of practice from heterogeneous interacting agents Copyright : Copyright (c) Olivier Dupouet, Murat Yildizoglu
| Field Summary | |
private Agent[] |
agentSet
The list of agents |
private java.util.Vector |
agSet
The created agents list for purpose of communication |
private static XCSConstants |
cons
Stores the relevant constants for XCS. |
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. |
private java.io.File |
outFile1
Stores the specified output File, where the performance will be written. |
private java.io.File |
outFile2
Stores the specified output File, where the performance will be written. |
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,
Environment envt,
java.lang.String outFileString1,
java.lang.String outFileString2)
Constructor for the initial population of agents |
|
| 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(java.io.PrintWriter pW1,
java.io.PrintWriter pW2)
Executes one single-step experiment monitoring the performance. |
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. |
static void |
main(java.lang.String[] args)
The Main loop |
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 |
startExperiments(java.io.PrintWriter pW1,
java.io.PrintWriter pW2)
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 java.io.File outFile1
private java.io.File outFile2
private int maxProblems
private int nrExps
private static AgentsPopulations wholePopulation
private static int totalNumberOfAgents
private Agent[] agentSet
private java.util.Vector agSet
public Environment env
private static XCSConstants cons
XCSConstants| Constructor Detail |
public AgentsPopulations(int nbAgents,
Environment envt,
java.lang.String outFileString1,
java.lang.String outFileString2)
nbAgents - Number of Agents used in the experimentsenvt - The environment chosen for the experimentoutFileString1 - Name of the first file where results are storedoutFileString2 - Name of the second file where results are stored| Method Detail |
public static void main(java.lang.String[] args)
args - The parameters passed to the programmepublic 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 numbre of experimentspublic void runExperiment(Environment envt)
startExperiments(java.io.PrintWriter, java.io.PrintWriter)
private void startExperiments(java.io.PrintWriter pW1,
java.io.PrintWriter pW2)
pW1 - This print writer refers to the first output file for
matrices of relationships.pW2 - This print writer refers to the first output file for various
characteristics of agents.Agent.Agent(),
Book#Book(int, int),
XClassifierSet.XClassifierSet(int, int),
Agent.setAddressBook(Book),
Agent.setXClassifierSet(XClassifierSet),
doOneSingleStepExperiment(java.io.PrintWriter, java.io.PrintWriter)
void doOneSingleStepExperiment(java.io.PrintWriter pW1,
java.io.PrintWriter pW2)
pW1 - This print writer refers to the first output file for
matrices of relationships.pW2 - This print writer refers to the first output file for various
characteristics of agents.Agent#doOneSingleStepProblemExplore(String, int, int),
square#resetState(),
#buildRelationships(),
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 agents
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||