My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
BuiltInAgents14  
Built-in agents(Modeling Guide)
Updated Dec 2, 2011 by benoit.g...@gmail.com



Introduction

It is possible to use in the models a set of built-in agents. These agents allow to directly use some advance features like clustering, multi-criteria analysis, etc. The creation of these agents are similar as for other kinds of agents:

create species: my_built_in_agent return: the_agent;	

The list of available built-in agents in GAMA is:

  • cluster_builder: allows to use clustering techniques on a set of agents.
  • multicriteria_analyzer: allows to use multi-criteria analysis methods.

So, for instance, to be able to use clustering techniques in the model:

create species: cluster_builder return: clusterer;

cluster_builder

The cluster_builder agent allows to divide a set of agents into different clusters according to the values of some of their attributes. This agents is built from the weka library: most of the clustering algorithms are directlty based on their weka implementation.

actions

simple_clustering_by_distance

Returns groups of agents using hierarchical clustering. The distance between agents are directly computed from the agent locations (euclidean distance). The distance between two groups of agents corresponds to the min of distances between the agents of each group.

  • → agents: list, the list of Entities to be divided into groups.
  • → dist_min: float, minimal distance between two groups. By default, num_clusters = -1.
  • → distance_geom: bool, optional, if true, uses the distance between the agent geometry; otherwise uses the distance between the agent centroid (more optimize). By default, distance_geom = false.
  • ← return: list, a list of groups; each group is a list of agents.

let ags type: list of: agent value: [agentA, agentB, agentC, agentD, agentE];
let groups type: list value: self.simple_clustering_by_distance [agents::ags, dist_min::10.0];

clustering_cobweb

Returns groups of agents using the Cobweb and Classit clustering algorithms (Weka implementation). For more information see: D. Fisher (1987). Knowledge acquisition via incremental conceptual clustering. Machine Learning. 2(2):139-172; J. H. Gennari, P. Langley, D. Fisher (1990). Models of incremental concept formation. Artificial Intelligence. 40:11-61.

  • → agents: list, the list of Entities to be divided into groups.
  • → attributes: list, the list of the agent attributes (string: the attribute names) used to divide the agents into groups. For the moment, only numeric attributes are considered.
  • → acuity: float, optional, minimum standard deviation for numeric attributes. By default, acuity = 1.0.
  • → cutt_off: float, optional, set the category utility threshold by which to prune nodes. By default, cutoff = 0.0028209479177387815.
  • → seed, int, optional, The random number seed to be used. By default, seed = 42.
  • ← return: list, a list of groups; each group is a list of agents.

let ags type: list of: agent value: [agentA, agentB, agentC, agentD, agentE];
let attribs type: list of: string value: ['area','food_quantity','proximity_to_roads'];
let groups type: list value: self.clustering_cobweb [agents::ags, attributes::attribs];

clustering_DBScan

Returns groups of agents using the DBScan algorithm (Weka implementation). For more information see: Martin Ester, Hans-Peter Kriegel, Joerg Sander, Xiaowei Xu: A Density-Based Algorithm for Discovering Clusters in Large Spatial Databases with Noise. In: Second International Conference on Knowledge Discovery and Data Mining, 226-231, 1996.

  • → agents: list, the list of Entities to be divided into groups.
  • → attributes: list, the list of the agent attributes (string: the attribute names) used to divide the agents into groups. For the moment, only numeric attributes are considered.
  • → distance_f: string, optional, The distance function to use : 2 possible distance functions: (by default) euclidean; and 'manhattan'.
  • → epsilon: float, optional, radius of the epsilon-range-queries. By default, epsilon = 0.9.
  • → min_points: int, optional, minimun number of DataObjects required in an epsilon-range-query. By default, min_points = 6.
  • ← return: list, a list of groups; each group is a list of agents.

let ags type: list of: agent value: [agentA, agentB, agentC, agentD, agentE];
let attribs type: list of: string value: ['area','food_quantity','proximity_to_roads'];
let groups type: list value: self.clustering_DBScan [agents::ags, attributes::attribs];

clustering_em

Returns groups of agents using the EM (expectation maximisation) algorithm (Weka implementation).

  • → agents: list, the list of Entities to be divided into groups.
  • → attributes: list, the list of the agent attributes (string: the attribute names) used to divide the agents into groups. For the moment, only numeric attributes are considered.
  • → max_iterations: int, optional, the maximum number of iterations to perform. By default, max_iterations = 100.
  • → num_clusters: int, optional, set number of clusters. if num_clusters equals -1, EM decides how many clusters to create by cross validation. By default, num_clusters = -1.
  • → min_std_dev: float, optional, set minimum allowable standard deviation. By default, min_std_dev = 1.0E-6.
  • → seed, int, optional, The random number seed to be used. By default, seed = 100.
  • ← return: list, a list of groups; each group is a list of agents.

let ags type: list of: agent value: [agentA, agentB, agentC, agentD, agentE];
let attribs type: list of: string value: ['area','food_quantity','proximity_to_roads'];
let groups type: list value: self.clustering_em [agents::ags, attributes::attribs];

clustering_farthestFirst

Returns groups of agents using the farthestFirst algorithm (Weka implementation). For more information see: Hochbaum, Shmoys (1985). A best possible heuristic for the k-center problem. Mathematics of Operations Research. 10(2):180-184.

  • → agents: list, the list of Entities to be divided into groups.
  • → attributes: list, the list of the agent attributes (string: the attribute names) used to divide the agents into groups. For the moment, only numeric attributes are considered.
  • → num_clusters: int, optional, set number of clusters. By default, num_clusters = 2.
  • → seed, int, optional, The random number seed to be used. By default, seed = 1.
  • ← return: list, a list of groups; each group is a list of agents.

let ags type: list of: agent value: [agentA, agentB, agentC, agentD, agentE];
let attribs type: list of: string value: ['area','food_quantity','proximity_to_roads'];
let groups type: list value: self.clustering_farthestFirst [agents::ags, attributes::attribs];

clustering_simple_kmeans

Returns groups of agents using the K-Means algorithm (Weka implementation).

  • → agents: list, the list of Entities to be divided into groups.
  • → attributes: list, the list of the agent attributes (string: the attribute names) used to divide the agents into groups. For the moment, only numeric attributes are considered.
  • → distance_f: string, optional, The distance function to use : 4 possible distance functions: (by default) euclidean; otherwise, 'chebyshev', 'manhattan' and 'levenshtein'.
  • → dont_replace_missing_values: bool, optional, Replace missing values globally with mean/mode. By default, dont_replace_missing_values = false.
  • → max_iterations: int, optional, the maximum number of iterations to perform. By default, max_iterations = 500.
  • → num_clusters: int, optional, set number of clusters. By default, num_clusters = 2.
  • → preserve_instances_order: bool, optional, Preserve order of instances. By default, preserve_instances_order = false.
  • → seed, int, optional, The random number seed to be used. By default, seed = 10.
  • ← return: list, a list of groups; each group is a list of agents.

let ags type: list of: agent value: [agentA, agentB, agentC, agentD, agentE];
let attribs type: list of: string value: ['area','food_quantity','proximity_to_roads'];
let groups type: list value: self.clustering_simple_kmeans [agents::ags, attributes::attribs];

clustering_xmeans

Returns groups of agents using the X-Means algorithm (Weka implementation). "X-Means is K-Means extended by an Improve-Structure part. In this part of the algorithm the centers are attempted to be split in its region. The decision between the children of each center and itself is done comparing the BIC-values of the two structures. For more information see: Dan Pelleg, Andrew W. Moore: X-means: Extending K-means with Efficient Estimation of the Number of Clusters. In: Seventeenth International Conference on Machine Learning, 727-734, 2000." (Weka documentation).

  • → agents: list, the list of Entities to be divided into groups.
  • → attributes: list, the list of the agent attributes (string: the attribute names) used to divide the agents into groups. For the moment, only numeric attributes are considered.
  • → bin_value: float, optional, Set the value that represents true in the new attributes. By default, bin_value = 1.0.
  • → cut_off_factor: float, optional, the cut-off factor to use. By default, cut_off_factor = 0.5.
  • → distance_f: string, optional, The distance function to use : 4 possible distance functions: (by default) euclidean; otherwise, 'chebyshev', 'manhattan' and 'levenshtein'
  • → max_iterations: int, optional, the maximum number of iterations to perform. By default, max_iterations = 1.
  • → max_kmeans: int, optional, the maximum number of iterations to perform in KMeans. By default, max_iterations = 1000.
  • → max_kmeans_for_children: int, optional, the maximum number of iterations KMeans that is performed on the child centers. By default, max_kmeans_for_children = 1000.
  • → max_num_clusters: int, optional, set maximum number of clusters. By default, max_num_clusters = 4.
  • → min_num_clusters: int, optional, set minimum number of clusters. By default, min_num_clusters = 2.
  • → seed, int, optional, The random number seed to be used. By default, seed = 10.
  • ← return: list, a list of groups; each group is a list of agents.

let ags type: list of: agent value: [agentA, agentB, agentC, agentD, agentE];
let attribs type: list of: string value: ['area','food_quantity','proximity_to_roads'];
let groups type: list value: self.clustering_xmeans [agents::ags, attributes::attribs];

multicriteria_analyzer

The multicriteria_analyzer agent allows to make a decision from a set of candidate solutions according to a set of criteria.

actions

weighted_means_DM

Returns the index of the candidate with the highest utility. The utility of each candidate is computed by a weighted means.

  • → criteria: list, the list of criteria. A criterion is a map that contains two elements: a name, and a weight.
  • → candidates: list, the list of candidates. A candidate is a list of floats; each float representing the value of a criterion for this candidate.
  • ← return: int, the index of the selected candidate.

let crits type: list value: [[name::'proximity', weight::1], [name::'quality', weight::3], [name::'usefulness', weight::2]];
let cands type: list value: [[0.8, 0.1, 0.3],[0.5, 0.7, 0.5],[0.1, 0.5, 0.9],[0.9, 0.2, 0.4],[0.6, 0.5, 0.5],[0.7, 0.4, 0.3]];
let index type: int value: self.weighted_means_DM [criteria::crits, candidates::cands];

promethee_DM

Returns the index of the best candidate according to the Promethee II method. This method is based on a comparison per pair of possible candidates along each criterion: all candidates are compared to each other by pair and ranked. More information about this method can be found in Behzadian, M., Kazemzadeh, R., Albadvi, A., M., A.: PROMETHEE: A comprehensive literature review on methodologies and applications. European Journal of Operational Research(2009)

  • → criteria: list, the list of criteria. A criterion is a map that contains fours elements: a name, a weight, a preference value (p) and an indifference value (q). The preference value represents the threshold from which the difference between two criterion values allows to prefer one vector of values over another. The indifference value represents the threshold from which the difference between two criterion values is considered significant.
  • → candidates: list, the list of candidates. A candidate is a list of floats; each float representing the value of a criterion for this candidate.
  • ← return: int, the index of the selected candidate.

let crits type: list value: [[name::'proximity', weight::1, p::0.9, q::0.1], [name::'quality', weight::3, p::1.0, q::0.0],[name::'usefulness', weight::2, p::0.8, q::0.2]];
let cands type: list value: [[0.8, 0.1, 0.3],[0.5, 0.7, 0.5],[0.1, 0.5, 0.9],[0.9, 0.2, 0.4],[0.6, 0.5, 0.5],[0.7, 0.4, 0.3]];
let index type: int value: self.promethee_DM [criteria::crits, candidates::cands];

electre_DM

Returns the index of the best candidate according to a method based on the ELECTRE methods. The principle of the ELECTRE methods is to compare the possible candidates by pair. These methods analyses the possible outranking relation existing between two candidates. An candidate outranks another if this one is at least as good as the other one. The ELECTRE methods are based on two concepts: the concordance and the discordance. The concordance characterises the fact that, for an outranking relation to be validated, a sufficient majority of criteria should be in favor of this assertion. The discordance characterises the fact that, for an outranking relation to be validated, none of the criteria in the minority should oppose too strongly this assertion. These two conditions must be true for validating the outranking assertion. More information about the ELECTRE methods can be found in Figueira, J., Mousseau, V., Roy, B.: ELECTRE Methods. In: Figueira, J., Greco, S., and Ehrgott, M., (Eds.), Multiple Criteria Decision Analysis: State of the Art Surveys, Springer, New York, 133--162 (2005)

  • → criteria: list, the list of criteria. A criterion is a map that contains fives elements: a name, a weight, a preference value (p), an indifference value (q) and a veto value (v). The preference value represents the threshold from which the difference between two criterion values allows to prefer one vector of values over another. The indifference value represents the threshold from which the difference between two criterion values is considered significant. The veto value represents the threshold from which the difference between two criterion values disqualifies the candidate that obtained the smaller value.
  • → candidates: list, the list of candidates. A candidate is a list of floats; each float representing the value of a criterion for this candidate.
  • ← return: int, the index of the selected candidate.

let crits type: list value: [[name::'proximity', weight::1, p::0.9, q::0.1, v::0.95], [name::'quality', weight::3, p::0.8, q::0.0, v:1.0], 
     [name::'usefulness', weight::2, p::0.8, q::0.2, v::0.9]];
let cands type: list value: [[0.8, 0.1, 0.3],[0.5, 0.7, 0.5],[0.1, 0.5, 0.9],[0.9, 0.2, 0.4],[0.6, 0.5, 0.5],[0.7, 0.4, 0.3]];
let index type: int value: self.electre_DM [criteria::crits, candidates::cands];

evidence_theory_DM

Returns the index of the best candidate according to a method based on the Evidence theory. This theory, which was proposed by Shafer (Shafer G (1976) A mathematical theory of evidence, Princeton University Press), is based on the work of Dempster (Dempster A (1967) Upper and lower probabilities induced by multivalued mapping. Annals of Mathematical Statistics, vol. 38, pp. 325--339) on lower and upper probability distributions.

  • → criteria: list, the list of criteria. A criterion is a map that contains seven elements: a name, a first threshold s1, a second threshold s2, a value for the assertion "this candidate is the best" at threshold s1 (v1p), a value for the assertion "this candidate is the best" at threshold s2 (v2p), a value for the assertion "this candidate is not the best" at threshold s1 (v1c), a value for the assertion "this candidate is not the best" at threshold s2 (v2c). v1p, v2p, v1c and v2c have to been defined in order that: v1p + v1c <= 1.0; v2p + v2c <= 1.0.
  • → candidates: list, the list of candidates. A candidate is a list of floats; each float representing the value of a criterion for this candidate.
  • ← return: int, the index of the selected candidate.

let crits type: list value: [[name::'proximity', s1::0.1, s2::0.8, v1p::0, v2p::0.3, v1c::0.5, v2c::0], [name::'quality',s1::0.0, s2::0.8, v1p::0.05, v2p::0.5, v1c::0.6, v2c::0], [name::'usefulness', s1::0.0, s2::0.8, v1p::0, v2p::0.2, v1c::0.9, v2c::0]];
let cands type: list value: [[0.8, 0.1, 0.3],[0.5, 0.7, 0.5],[0.1, 0.5, 0.9],[0.9, 0.2, 0.4],[0.6, 0.5, 0.5],[0.7, 0.4, 0.3]];
let index type: int value: self.evidence_theory_DM [criteria::crits, candidates::cands];

Sign in to add a comment
Powered by Google Project Hosting