Multicriteria decision Multicriteria

Julien Mazars edited this page May 20, 2016 · 3 revisions

Multicriteria

Author : Patrick Taillandier

This model show how to use different methods of multicriteria analysis to look for the best house. Four methods are used : the Weighted_Means method , the Electre method , the Promethee method an the Evidence Theory method. Each method uses different criteria with different weights according to the methods used.

Code of the model :


model multicriteria

global {
	float weight_standing <- 1.0;
	float weight_price <- 1.0;
	float weight_distance <- 1.0;
	float weight_area <- 1.0;
	float p_standing <- 0.5;
	float p_price <- 0.5;
	float p_distance <- 0.5;
	float p_area <- 0.5;
	float q_standing <- 0.0;
	float q_price <- 0.0;
	float q_distance <- 0.0;
	float q_area <- 0.0;
	float v_standing <- 1.0;
	float v_price <- 1.0;
	float v_distance <- 1.0;
	float v_area <- 1.0;
	float s_standing <- 1.0;
	float s_price <- 1.0;
	float s_distance <- 1.0;
	float s_area <- 1.0;
	float s1_standing <- 0.0;
	float s1_price <- 0.0;
	float s1_distance <- 0.0;
	float s1_area <- 0.0;
	float s2_standing <- 1.0;
	float s2_price <- 1.0;
	float s2_distance <- 1.0;
	float s2_area <- 1.0;
	float v1p_standing <- 0.0;
	float v1p_price <- 0.0;
	float v1p_distance <- 0.0;
	float v1p_area <- 0.0;
	float v2p_standing <- 1.0;
	float v2p_price <- 1.0;
	float v2p_distance <- 1.0;
	float v2p_area <- 1.0;
	float v1c_standing <- 0.0;
	float v1c_price <- 0.0;
	float v1c_distance <- 0.0;
	float v1c_area <- 0.0;
	float v2c_standing <- 0.0;
	float v2c_price <- 0.0;
	float v2c_distance <- 0.0;
	float v2c_area <- 0.0;
	
	//Lists that will store the different criteria to use for each method linked with their weights
	list criteria_WM <- [["name"::"standing", "weight" :: weight_standing],["name"::"price", "weight" :: weight_price],["name"::"distance", "weight" ::weight_distance],["name"::"area", "weight" :: weight_area]]; 
	list criteria_Electre <- [["name"::"standing", "weight" :: weight_standing, "p"::p_standing, "q"::q_standing, "v"::v_standing, "maximize" :: true],["name"::"price", "weight" :: weight_price, "p"::p_price, "q"::q_price, "v"::v_price,  "maximize" :: true],["name"::"distance", "weight" ::weight_distance, "p"::p_distance, "q"::q_distance, "v"::v_distance,  "maximize" :: true],["name"::"area", "weight" :: weight_area,  "p"::p_area, "q"::q_area, "v"::v_area,  "maximize" :: true]]; 
	list criteria_Promethee <- [["name"::"standing", "weight" :: weight_standing, "p"::p_standing, "q"::q_standing, "s"::s_standing, "maximize" :: true],["name"::"price", "weight" :: weight_price, "p"::p_price, "q"::q_price, "s"::s_price,  "maximize" :: true],["name"::"distance", "weight" ::weight_distance, "p"::p_distance, "q"::q_distance, "s"::s_distance,  "maximize" :: true],["name"::"area", "weight" :: weight_area,  "p"::p_area, "q"::q_area, "s"::s_area,  "maximize" :: true]];  
	list criteria_ET <- [["name"::"standing", "s1"::s1_standing, "s2"::s2_standing, "v1p"::v1p_standing, "v2p"::v2p_standing, "v1c"::v1c_standing, "v2c"::v2c_standing,"maximize" :: true],["name"::"price", "s1"::s1_price, "s2"::s2_price, "v1p"::v1p_price, "v2p"::v2p_price, "v1c"::v1c_price, "v2c"::v2c_price,  "maximize" :: true],["name"::"distance", "s1"::s1_distance, "s2"::s2_distance, "v1p"::v1p_distance, "v2p"::v2p_distance, "v1c"::v1c_distance, "v2c"::v2c_distance,  "maximize" :: true],["name"::"area", "s1"::s1_area, "s2"::s2_area, "v1p"::v1p_area, "v2p"::v2p_area, "v1c"::v1c_area, "v2c"::v2c_area, "maximize" :: true]];
	
	
	init {
		create people;
		geometry free_space <- copy(shape);
		free_space <- free_space - 10;
		create house number: 15 {
			location <- any_location_in (free_space);
			free_space <- free_space - (shape + 10);
		}
	}
	
	reflex reset_selected {
		ask house {
			is_selected_WM <- false;
			is_selected_electre <- false;
			is_selected_promethee <- false;
			is_selected_ET <- false;
		}
		criteria_WM <- [["name"::"standing", "weight" :: weight_standing],["name"::"price", "weight" :: weight_price],["name"::"distance", "weight" ::weight_distance],["name"::"area", "weight" :: weight_area]]; 
		criteria_Electre <- [["name"::"standing", "weight" :: weight_standing, "p"::p_standing, "q"::q_standing, "v"::v_standing, "maximize" :: true],["name"::"price", "weight" :: weight_price, "p"::p_price, "q"::q_price, "v"::v_price,  "maximize" :: true],["name"::"distance", "weight" ::weight_distance, "p"::p_distance, "q"::q_distance, "v"::v_distance,  "maximize" :: true],["name"::"area", "weight" :: weight_area,  "p"::p_area, "q"::q_area, "v"::v_area,  "maximize" :: true]]; 
		criteria_Promethee <- [["name"::"standing", "weight" :: weight_standing, "p"::p_standing, "q"::q_standing, "s"::s_standing, "maximize" :: true],["name"::"price", "weight" :: weight_price, "p"::p_price, "q"::q_price, "s"::s_price,  "maximize" :: true],["name"::"distance", "weight" ::weight_distance, "p"::p_distance, "q"::q_distance, "s"::s_distance,  "maximize" :: true],["name"::"area", "weight" :: weight_area,  "p"::p_area, "q"::q_area, "s"::s_area,  "maximize" :: true]]; 
		criteria_ET <- [["name"::"standing", "s1"::s1_standing, "s2"::s2_standing, "v1p"::v1p_standing, "v2p"::v2p_standing, "v1c"::v1c_standing, "v2c"::v2c_standing,"maximize" :: true],["name"::"price", "s1"::s1_price, "s2"::s2_price, "v1p"::v1p_price, "v2p"::v2p_price, "v1c"::v1c_price, "v2c"::v2c_price,  "maximize" :: true],["name"::"distance", "s1"::s1_distance, "s2"::s2_distance, "v1p"::v1p_distance, "v2p"::v2p_distance, "v1c"::v1c_distance, "v2c"::v2c_distance,  "maximize" :: true],["name"::"area", "s1"::s1_area, "s2"::s2_area, "v1p"::v1p_area, "v2p"::v2p_area, "v1c"::v1c_area, "v2c"::v2c_area, "maximize" :: true]];
	}
	
}
	

species people  {
	aspect default {
		draw sphere(2) color: °red;
	}
	
	reflex choose_house_weighted_means {
		list<list> cands <- houses_eval();
		int choice <- weighted_means_DM(cands, criteria_WM);
		if (choice >= 0) {
			ask (house at choice) {is_selected_WM <- true;}
		}
	}
	
	reflex choose_house_promethee {
		list<list> cands <- houses_eval();
		int choice <- promethee_DM(cands, criteria_Promethee);
		if (choice >= 0) {
			ask (house at choice) {is_selected_promethee <- true;}
		}
	}
	reflex choose_house_electre {
		list<list> cands <- houses_eval();
		int choice <- electre_DM(cands, criteria_Electre, 0.7);
		if (choice >= 0) {
			ask (house at choice) {is_selected_electre <- true;}
		}
	}
	reflex choose_house_evidence_theory {
		list<list> cands <- houses_eval();
		int choice <- evidence_theory_DM(cands, criteria_ET, true);
		if (choice >= 0) {
			ask (house at choice) {is_selected_ET <- true;}
		}
	}
	
	list<list> houses_eval {
		list<list> candidates;
		loop bat over: house {
			list<float> cand;
			add bat.standing / 5 to: cand;
			add ((500000 - bat.price) / 500000) to: cand;
			add ((100 - (self distance_to bat)) / 100) to: cand;
			add (bat.shape.area / 15^2) to: cand;
			add cand to: candidates;
		}
		return candidates;
	}
	
}

species house {
	bool is_selected_WM <- false;
	bool is_selected_electre <- false;
	bool is_selected_promethee <- false;
	bool is_selected_ET <- false;
	geometry shape <- square(5 + rnd(10));
	float price <- 100000.0 + rnd (400000);
	int standing <- rnd(5);
	rgb color <- rgb(255 * (1 - standing/5.0),255 * (1 - standing/5.0),255);
	float height <- price / 50000;
	aspect weighted_means {
		if (is_selected_WM) {
			draw shape + 2.0 color: °red;
		}
		draw shape color: color depth: height;
	}
	aspect electre_means {
		if (is_selected_electre) {
			draw shape + 2.0 color: °red;
		}
		draw shape color: color depth: height;
	}
	aspect promethee_means {
		if (is_selected_promethee) {
			draw shape + 2.0 color: °red;
		}
		draw shape color: color depth: height;
	}
	aspect evidence_theory_means {
		if (is_selected_ET) {
			draw shape + 2.0 color: °red;
		}
		draw shape color: color depth: height;
	}
}


experiment multicriteria type: gui {
	parameter "weight of the standing criterion" var:weight_standing category: "Weight";
	parameter "weight of the price criterion" var:weight_price category: "Weight";
	parameter "weight of the distance criterion" var:weight_distance category: "Weight";
	parameter "weight of the area criterion" var:weight_area category: "Weight";
	parameter "preference threshold of the standing criterion" var:p_standing category: "Preference";
	parameter "preference threshold of the price criterion" var:p_price category: "Preference";
	parameter "preference threshold of the distance criterion" var:p_distance category: "Preference";
	parameter "preference threshold of the area criterion" var:p_area category: "Preference";
	parameter "indifference threshold of the standing criterion" var:q_standing category: "Indifference";
	parameter "indifference threshold of the price criterion" var:q_price category: "Indifference";
	parameter "indifference threshold of the distance criterion" var:q_distance category: "Indifference";
	parameter "indifference threshold of the area criterion" var:q_area category: "Indifference";
	parameter "veto threshold of the standing criterion" var:v_standing category: "Veto";
	parameter "veto threshold of the price criterion" var:v_price category: "Veto";
	parameter "veto threshold of the distance criterion" var:v_distance category: "Veto";
	parameter "veto threshold of the area criterion" var:v_area category: "Veto";
	parameter "max prefence value of the standing criterion" var:v_standing category: "Max preference value";
	parameter "max prefence value of the price criterion" var:v_price category: "Max preference value";
	parameter "max prefence value of the distance criterion" var:v_distance category: "Max preference value";
	parameter "max prefence value of the area criterion" var:v_area category: "Max preference value";
	parameter "min criterion threshold of the standing criterion" var:s1_standing category: "Evidence Theory";
	parameter "min criterion threshold of the price criterion" var:s1_price category: "Evidence Theory";
	parameter "min criterion threshold of the distance criterion" var:s1_distance category: "Evidence Theory";
	parameter "min criterion threshold of the area criterion" var:s1_area category: "Evidence Theory";
	parameter "max criterion threshold of the standing criterion" var:s2_standing category: "Evidence Theory";
	parameter "max criterion threshold of the price criterion" var:s2_price category: "Evidence Theory";
	parameter "max criterion threshold of the distance criterion" var:s2_distance category: "Evidence Theory";
	parameter "max criterion threshold of the area criterion" var:s2_area category:"Evidence Theory";
	parameter "min preference of the standing criterion" var:v1p_standing category: "Evidence Theory";
	parameter "min preference of the price criterion" var:v1p_price category: "Evidence Theory";
	parameter "min preference of the distance criterion" var:v1p_distance category: "Evidence Theory";
	parameter "min preference of the area criterion" var:v1p_area category: "Evidence Theory";
	parameter "max preference of the standing criterion" var:v2p_standing category: "Evidence Theory";
	parameter "max preference of the price criterion" var:v2p_price category: "Evidence Theory";
	parameter "max preference of the distance criterion" var:v2p_distance category: "Evidence Theory";
	parameter "max preference of the area criterion" var:v2p_area category: "Evidence Theory";
	parameter "min rejection of the standing criterion" var:v1c_standing category: "Evidence Theory";
	parameter "min rejection of the price criterion" var:v1c_price category: "Evidence Theory";
	parameter "min rejection of the distance criterion" var:v1c_distance category: "Evidence Theory";
	parameter "min rejection of the area criterion" var:v1c_area category: "Evidence Theory";
	parameter "max rejection of the standing criterion" var:v2c_standing category: "Evidence Theory";
	parameter "max rejection of the price criterion" var:v2c_price category: "Evidence Theory";
	parameter "max rejection of the distance criterion" var:v2c_distance category: "Evidence Theory";
	parameter "max rejection of the area criterion" var:v2c_area category: "Evidence Theory";
	output {
		display Map_Weighted_Means type: opengl{
			species house aspect: weighted_means;
			species people;
		}
		display Map_Electre type: opengl{
			species house aspect: electre_means;
			species people;
		}
		display Map_Promethee type: opengl{
			species house aspect: promethee_means;
			species people;
		}
		display Map_Evidence_theory type: opengl{
			species house aspect: evidence_theory_means;
			species people;
		}
	}
}

Home

Introduction

Changes from 1.6.1 to 1.8

Platform

  1. Installation and Launching
  2. Installation
  3. Launching GAMA
  4. Headless Mode
  5. Updating GAMA
  6. Installing Plugins
  7. Troubleshooting
  8. Workspace, Projects and Models
  9. Navigating in the Workspace
  10. Changing Workspace
  11. Importing Models
  12. Editing Models
  13. GAML Editor (Generalities)
  14. GAML Editor Toolbar
  15. Validation of Models
  16. Running Experiments
  17. Launching Experiments
  18. Experiments User interface
  19. Menus and commands
  20. Parameters view
  21. Inspectors and monitors
  22. Displays
  23. Batch Specific UI
  24. Errors View
  25. Preferences

Learn GAML step by step

  1. Introduction
  2. Start with GAML
  3. Organization of a Model
  4. Basic programming concepts in GAML
  5. Manipulate basic Species
  6. Global Species
  7. Regular Species
  8. Defining Actions and Behaviors
  9. Interaction between Agents
  10. Attaching Skills
  11. Inheritance
  12. Defining Advanced Species
  13. Grid Species
  14. Graph Species
  15. Mirror Species
  16. Multi-Level Architecture
  17. Defining GUI Experiment
  18. Defining Parameters
  19. Defining Displays Generalities
  20. Defining Charts
  21. Defining 3D Displays
  22. Defining Monitors and Inspectors
  23. Defining Export files
  24. Defining User Interaction
  25. Exploring Models
  26. Run Several Simulations
  27. Batch Experiments
  28. Exploration Methods
  29. Optimizing Model Section
  30. Runtime Concepts
  31. Optimizing Models
  32. Multi-Paradigm Modeling
  33. Control Architecture
  34. Defining Equations

Recipes

  1. Manipulate OSM Datas
  2. Diffusion
  3. Using Database
  4. Calling R
  5. Using FIPA ACL
  6. Using GamAnalyzer
  7. Using BDI
  8. Using Driving Skill
  9. Manipulate dates
  10. Manipulate lights
  11. Using comodel
  12. Save and restore Simulations
  13. Using network
  14. Headless mode
  15. FAQ
  16. Known Issues

GAML References

  1. Built-in Species
  2. Agent Built-in
  3. Model Built-in
  4. Experiment Built-in
  5. Built-in Skills
  6. Built-in Architecture
  7. Statements
  8. Data Type
  9. File Type
  10. Expressions
  11. Literals
  12. Units and Constants
  13. Pseudo Variables
  14. Variables And Attributes
  15. Operators [A-A]
  16. Operators [B-C]
  17. Operators [D-H]
  18. Operators [I-M]
  19. Operators [N-R]
  20. Operators [S-Z]
  21. Index

Tutorials

  1. Predator Prey
  2. Road Traffic
  3. 3D Tutorial
  4. Incremental Model
  5. Luneray's flu
  6. Co-modeling
  7. BDI Agents

Pedagogical materials

Developing Extensions

  1. Installing the GIT version
  2. Architecture of GAMA
  3. Developing a Plugin
  4. Developing a Skill
  5. Developing a Statement
  6. Developing an Operator
  7. Developing a Type
  8. Developing a Species
  9. Developing a Control Architecture
  10. Index of annotations
  11. IScope
  12. Creating a release of GAMA
  13. Documentation generation
  14. Website generation

Scientific References

Projects using GAMA

Training Session

Events

Older versions

Coding Camp

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.