Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Morris experiments may set parameters out of bounds #367

Closed
ScriBanana opened this issue Oct 29, 2024 · 3 comments · Fixed by #369
Closed

Morris experiments may set parameters out of bounds #367

ScriBanana opened this issue Oct 29, 2024 · 3 comments · Fixed by #369
Assignees
Labels
About Batch This issue concerns batch experiments 😱 Bug The issue reveals a bug in GAMA

Comments

@ScriBanana
Copy link

ScriBanana commented Oct 29, 2024

Hi,

Describe the bug
Morris experiment sometimes sets parameters to values outside their assigned bounds. In particular, above 1.0 for a float with bounds 0.0 and 1.0. The parameter value in "Parameters to explore" gives the maximum value instead of the erroneous value taken by the parameter, as can be verified in the console or an assert statement, for example.

I have had no such issue with other exploration methods (Sobol or OFAT).

To Reproduce

model MorrisTest
global {
	bool endSim <- false;
	float a;
	float b;
	reflex roll {
		assert a <= 1.0;
		assert b <= 1.0;
		endSim <- true;
	}
}
experiment explo type: batch autorun: true until: endSim {
	parameter "a" var: a min: 0.0 max: 1.0;
	parameter "b" var: b min: 0.0 max: 1.0;
	method morris outputs: [] sample: 100 levels: 4 report: "morris.txt" results: "morris_raw.csv";
}

And check the value of the failed parameter in the console.

@ScriBanana
Copy link
Author

I tried to reproduce with the example from the library (Exploration.gaml) with the following modifications with no success.

experiment batch_abstract type:batch virtual:true until:(time > end_cycle) {
	init {is_batch <- true;}
	parameter "Predator energy transfer:" var: predator_energy_transfer min: 0.0 max: 1.0;
	parameter "Predator energy reproduce:" var: predator_energy_reproduce min: 0.0 max: 1.0;
}
experiment Morris parent: batch_abstract type: batch until:( time > 2 ) {
	init {
		assert predator_energy_transfer <= 1.0;
		assert predator_energy_reproduce <= 1.0;
	}
	method morris outputs:[] sample:100 levels:4 report:"Results/morris.txt" results:"Results/morris_raw.csv";
}

@lesquoyb lesquoyb added 😱 Bug The issue reveals a bug in GAMA About Batch This issue concerns batch experiments labels Oct 30, 2024
@chapuisk
Copy link
Contributor

chapuisk commented Nov 1, 2024

Hey @ScriBanana, I dig a bit in the sampling method and "mistakes were made". The problem should be solve as soon as the PR #369 has been reviewed and accepted.

@ScriBanana
Copy link
Author

Hi @chapuisk,
Nice, thanks ! I will try it out if I find the time.

lesquoyb added a commit that referenced this issue Nov 4, 2024
…-set-parameters-out-of-bounds

Solves #367 by reimplementing morris sampling method following SALib implementation to avoid parameters getting out of bounds
@lesquoyb lesquoyb moved this from Todo to Done in GAMA 2024-11 Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
About Batch This issue concerns batch experiments 😱 Bug The issue reveals a bug in GAMA
Projects
Status: Done
3 participants