Page 1 of 1

Script Measure

Posted: Tue Feb 06, 2024 4:02 am
by amini_opensim
Hello

I want to know when we use script measure to minimize a cos function, how we can determine what variable should be minimized in composite measure?

I have created a variable that I am going to minimize it by name MetabolicCost. But I doubt where I should write the MetabolicCost in composite measure. For example, the following code determines that MetabolicCost should be minimized?

CompositeMeasure {

<< import/measures/SelfSelectedSpeed.scone >>

ScriptMeasure {
name = MetabolicCost
weight = 1
minimize = 1
script_file = "import/measures/measureFUN.lua"
}


best

Re: Script Measure

Posted: Tue Feb 06, 2024 7:53 am
by tgeijten
You can always add "minimize = 1" in the top-level CompositeMeasure, just to be sure. Otherwise, the CompositeMeasure will try to determine this from the minimize setting of the child measures.