Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mvn chain fixed with the port of processor 2.0
- Loading branch information
Showing
11 changed files
with
163 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 45 additions & 45 deletions
90
msi.gama.core/tests/Multi-criteria Tests/models/multi-criteria.experiment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
/** | ||
* Name: multicriteria | ||
* Author: Patrick Taillandier | ||
* Description: Tests multi-criteria decision making operators | ||
* Tags: multi_criteria, test | ||
/** | ||
* Name: multicriteria | ||
* Author: Patrick Taillandier | ||
* Description: Tests multi-criteria decision making operators | ||
* Tags: multi_criteria, test | ||
*/ | ||
|
||
model multicriteriaTest | ||
|
||
experiment TopologyTests type: test { | ||
list<list<float>> candidates <- [[1.0,1.0,1.0],[2.0,0.0,1.0],[0.0,0.0,0.0],[1.0,2.0,0.0],[0.0,0.5,3.0]]; | ||
|
||
test "weighted_means_DM"{ | ||
list criteria_WM <- [["name"::"C1", "weight" :: 1.0],["name"::"C2", "weight" :: 2.0],["name"::"C3", "weight" ::3.0]]; | ||
int choice <- weighted_means_DM(candidates,criteria_WM); | ||
assert choice = 4; | ||
} | ||
|
||
test "electre_DM"{ | ||
list criteria_WM <- [["name"::"C1", "weight" :: 1.0, "p"::2.0, "q"::0.0, "v"::2.0, "maximize" :: true],["name"::"C2", "weight" :: 2.0, "p"::2.0, "q"::0.0, "v"::2.0, "maximize" :: true],["name"::"C3", "weight" ::3.0, "p"::2.0, "q"::0.0, "v"::2.0, "maximize" :: true]]; | ||
int choice <- electre_DM(candidates,criteria_WM, 0.7); | ||
assert choice = 4; | ||
} | ||
|
||
test "promethee_DM"{ | ||
list criteria_Promethee <- [["name"::"C1", "weight" :: 1.0, "p"::2.0, "q"::0.0, "s"::3.0, "maximize" :: true],["name"::"C2", "weight" :: 2.0, "p"::2.0, "q"::0.0, "s"::3.0, "maximize" :: true],["name"::"C3", "weight" ::1.0, "p"::2.0, "q"::0.0, "s"::3.0, "maximize" :: true]]; | ||
int choice <- promethee_DM(candidates,criteria_Promethee); | ||
assert choice = 3; | ||
} | ||
|
||
test "evidence_theory_DM"{ | ||
list criteria_ET <- [["name"::"C1", "s1"::0.0, "s2"::3.0, "v1p"::0.0, "v2p"::1.0, "v1c"::0.0, "v2c"::0.0,"maximize" :: true],["name"::"C2", "s1"::0.0, "s2"::3.0, "v1p"::0.0, "v2p"::2.0, "v1c"::0.0, "v2c"::0.0,"maximize" :: true],["name"::"C3", "s1"::0.0, "s2"::3.0, "v1p"::0.0, "v2p"::3.0, "v1c"::0.0, "v2c"::0.0,"maximize" :: true]]; | ||
int choice <- evidence_theory_DM(candidates,criteria_ET, true); | ||
assert choice = 4; | ||
|
||
choice <- evidence_theory_DM(candidates,criteria_ET, false); | ||
assert choice = 0; | ||
} | ||
|
||
test "fuzzy_choquet_DM"{ | ||
map<list<string>,float> criteria_FC <- ([["C1"]::1.0, ["C2"]::2.0, ["C3"]:: 3.0,["C1","C2"]::1.0]); | ||
int choice <- fuzzy_choquet_DM(candidates,["C1", "C2", "C3"],criteria_FC); | ||
assert choice = 4; | ||
} | ||
} | ||
|
||
|
||
model multicriteriaTest | ||
experiment TopologyTests type: test { | ||
list<list<float>> candidates <- [[1.0,1.0,1.0],[2.0,0.0,1.0],[0.0,0.0,0.0],[1.0,2.0,0.0],[0.0,0.5,3.0]]; | ||
test "weighted_means_DM"{ | ||
list criteria_WM <- [["name"::"C1", "weight" :: 1.0],["name"::"C2", "weight" :: 2.0],["name"::"C3", "weight" ::3.0]]; | ||
int choice <- weighted_means_DM(candidates,criteria_WM); | ||
assert choice = 4; | ||
} | ||
test "electre_DM"{ | ||
list criteria_WM <- [["name"::"C1", "weight" :: 1.0, "p"::2.0, "q"::0.0, "v"::2.0, "maximize" :: true],["name"::"C2", "weight" :: 2.0, "p"::2.0, "q"::0.0, "v"::2.0, "maximize" :: true],["name"::"C3", "weight" ::3.0, "p"::2.0, "q"::0.0, "v"::2.0, "maximize" :: true]]; | ||
int choice <- electre_DM(candidates,criteria_WM, 0.7); | ||
assert choice = 4; | ||
} | ||
test "promethee_DM"{ | ||
list criteria_Promethee <- [["name"::"C1", "weight" :: 1.0, "p"::2.0, "q"::0.0, "s"::3.0, "maximize" :: true],["name"::"C2", "weight" :: 2.0, "p"::2.0, "q"::0.0, "s"::3.0, "maximize" :: true],["name"::"C3", "weight" ::1.0, "p"::2.0, "q"::0.0, "s"::3.0, "maximize" :: true]]; | ||
int choice <- promethee_DM(candidates,criteria_Promethee); | ||
assert choice = 3; | ||
} | ||
test "evidence_theory_DM"{ | ||
list criteria_ET <- [["name"::"C1", "s1"::0.0, "s2"::3.0, "v1p"::0.0, "v2p"::1.0, "v1c"::0.0, "v2c"::0.0,"maximize" :: true],["name"::"C2", "s1"::0.0, "s2"::3.0, "v1p"::0.0, "v2p"::2.0, "v1c"::0.0, "v2c"::0.0,"maximize" :: true],["name"::"C3", "s1"::0.0, "s2"::3.0, "v1p"::0.0, "v2p"::3.0, "v1c"::0.0, "v2c"::0.0,"maximize" :: true]]; | ||
int choice <- evidence_theory_DM(candidates,criteria_ET, true); | ||
assert choice = 4; | ||
choice <- evidence_theory_DM(candidates,criteria_ET, false); | ||
assert choice = 0; | ||
} | ||
test "fuzzy_choquet_DM"{ | ||
map<list<string>,float> criteria_FC <- ([["C1"]::1.0, ["C2"]::2.0, ["C3"]:: 3.0,["C1","C2"]::1.0]); | ||
int choice <- fuzzy_choquet_DM(candidates,["C1", "C2", "C3"],criteria_FC); | ||
assert choice = 4; | ||
} | ||
} | ||
90 changes: 45 additions & 45 deletions
90
msi.gama.core/tests/Spatial Tests/models/Operators.experiment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
/** | ||
* Name: Spatial Operators | ||
* Author: Patrick Taillandier | ||
* Description: Tests various spatial operators | ||
* Tags: spatial, operators, test | ||
*/ | ||
/** | ||
* Name: Spatial Operators | ||
* Author: Patrick Taillandier | ||
* Description: Tests various spatial operators | ||
* Tags: spatial, operators, test | ||
*/ | ||
|
||
experiment OperatorsTest type: test { | ||
test "add_point" { | ||
assert (geometry(nil) add_point {20,20}) = nil; | ||
assert ({10,10} add_point point(nil)) = {10,10}; | ||
assert ({10,10} add_point {20,20}) = line([{10,10},{20,20}]); | ||
assert (line([{10,10},{20,20}]) add_point {30,30}) = line([{10,10},{20,20},{30,30}]); | ||
assert (line([{10,10},{20,20},{30,30}]) add_point {0,0}) = line([{0,0},{10,10},{20,20},{30,30}]); | ||
assert (line([{10,10},{20,20},{30,30}]) add_point {25,22}) = line([{10,10},{20,20},{25,22},{30,30}]); | ||
assert ((square(10) at_location {50,50}) add_point {50,35}) = polygon([{45,55}, {55,55}, {55,45}, {50,35},{45,45}]); | ||
assert ((square(10) at_location {50,50}) add_point {50,50}) = polygon([{45,55}, {50,50}, {55,55},{55,45},{45,45}]); | ||
} | ||
test "inter" { | ||
assert geometry(nil) inter {10,10} = nil; | ||
assert {10,10} inter geometry(nil) = nil; | ||
assert {10,10} inter {20,10} = nil; | ||
assert {10,10} inter {10,10} = {10,10}; | ||
assert line([{10,10},{20,20}]) inter {10,10} = {10,10}; | ||
assert line([{10,10},{20,20}]) inter {20,10} = nil; | ||
assert line([{10,10},{20,20}]) inter line([{5,5},{15,15}]) = line([{10,10},{15,15}]); | ||
assert line([{10,5},{10,20}]) inter line([{5,15},{30,15}]) distance_to {10,15} < 0.1; | ||
} | ||
test "minus" { | ||
assert geometry(nil) - {10,10} = nil; | ||
assert geometry({10,10}) - geometry(nil) = {10,10}; | ||
assert (square(10) - {10,10}).area = 100.0; | ||
assert length((line([{0,10},{20,10}]) - line([{10,0},{10,25}])).geometries) = 2 ; | ||
assert ((square(10) at_location {0,0}) - (square(10) at_location {5,0})) = polygon ([{-5,5},{0,5},{0,-5},{-5,-5}]); | ||
} | ||
test "union" { | ||
assert geometry(nil) union {10,10} = {10,10} ; | ||
assert {10,10} union geometry(nil) = {10,10} ; | ||
assert union([line([{0,10},{20,10}]) , line([{20,10},{30,10}])]).perimeter = 30.0 ; | ||
} | ||
test "masked_by" { | ||
} | ||
test "split_at" { | ||
assert (line([{0,0},{100,0}]) split_at {50,0}) = [line([{0,0},{50,0}]), line([{50,0},{100,0}])]; | ||
} | ||
} | ||
experiment OperatorsTest type: test { | ||
test "add_point" { | ||
assert (geometry(nil) add_point {20,20}) = nil; | ||
assert ({10,10} add_point point(nil)) = {10,10}; | ||
assert ({10,10} add_point {20,20}) = line([{10,10},{20,20}]); | ||
assert (line([{10,10},{20,20}]) add_point {30,30}) = line([{10,10},{20,20},{30,30}]); | ||
assert (line([{10,10},{20,20},{30,30}]) add_point {0,0}) = line([{0,0},{10,10},{20,20},{30,30}]); | ||
assert (line([{10,10},{20,20},{30,30}]) add_point {25,22}) = line([{10,10},{20,20},{25,22},{30,30}]); | ||
assert ((square(10) at_location {50,50}) add_point {50,35}) = polygon([{45,55}, {55,55}, {55,45}, {50,35},{45,45}]); | ||
assert ((square(10) at_location {50,50}) add_point {50,50}) = polygon([{45,55}, {50,50}, {55,55},{55,45},{45,45}]); | ||
} | ||
test "inter" { | ||
assert geometry(nil) inter {10,10} = nil; | ||
assert {10,10} inter geometry(nil) = nil; | ||
assert {10,10} inter {20,10} = nil; | ||
assert {10,10} inter {10,10} = {10,10}; | ||
assert line([{10,10},{20,20}]) inter {10,10} = {10,10}; | ||
assert line([{10,10},{20,20}]) inter {20,10} = nil; | ||
assert line([{10,10},{20,20}]) inter line([{5,5},{15,15}]) = line([{10,10},{15,15}]); | ||
assert line([{10,5},{10,20}]) inter line([{5,15},{30,15}]) distance_to {10,15} < 0.1; | ||
} | ||
test "minus" { | ||
assert geometry(nil) - {10,10} = nil; | ||
assert geometry({10,10}) - geometry(nil) = {10,10}; | ||
assert (square(10) - {10,10}).area = 100.0; | ||
assert length((line([{0,10},{20,10}]) - line([{10,0},{10,25}])).geometries) = 2 ; | ||
assert ((square(10) at_location {0,0}) - (square(10) at_location {5,0})) = polygon ([{-5,5},{0,5},{0,-5},{-5,-5}]); | ||
} | ||
test "union" { | ||
assert geometry(nil) union {10,10} = {10,10} ; | ||
assert {10,10} union geometry(nil) = {10,10} ; | ||
assert union([line([{0,10},{20,10}]) , line([{20,10},{30,10}])]).perimeter = 30.0 ; | ||
} | ||
test "masked_by" { | ||
} | ||
test "split_at" { | ||
assert (line([{0,0},{100,0}]) split_at {50,0}) = [line([{0,0},{50,0}]), line([{50,0},{100,0}])]; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.