Verbosity level

OpenSim Moco is a software toolkit to solve optimal control problems with musculoskeletal models defined in OpenSim using the direct collocation method.
POST REPLY
User avatar
Pagnon David
Posts: 82
Joined: Mon Jan 06, 2014 3:13 am

Verbosity level

Post by Pagnon David » Tue Nov 07, 2023 9:08 am

Hi there,

This matters very little, but I've seen several examples where verbosity is set to 2:

Code: Select all

solver.set_verbosity(2)
However, from the source code it seems like there are only level 0 and 1:

Code: Select all

/// How much information should be spewed to the console?
/// 0: tropter and the underlying solver are silent.
/// 1: tropter is verbose, and the underlying solver uses its default
/// verbosity.
void set_verbosity(int value);

Code: Select all

void Solver::set_verbosity(int verbosity) {
TROPTER_VALUECHECK(verbosity == 0 || verbosity == 1,
        "verbosity", verbosity, "0 or 1");
m_verbosity = verbosity;
m_problem->set_verbosity(verbosity);
}
Am I not looking in the right place? If not, could you tell me about it?

Thank you again!

User avatar
Nicholas Bianco
Posts: 963
Joined: Thu Oct 04, 2012 8:09 pm

Re: Verbosity level

Post by Nicholas Bianco » Tue Nov 07, 2023 3:16 pm

Hi David,

That code snippet is from the MocoTropterSolver, which only has two verbosity levels. MocoCasADiSolver (the default solver) has three verbosity levels: 0, 1, and 2 (or higher).

Here's where we set the verbosity level when configuring a MocoCasADiSolver: https://github.com/opensim-org/opensim- ... r.cpp#L252.

-Nick

User avatar
Pagnon David
Posts: 82
Joined: Mon Jan 06, 2014 3:13 am

Re: Verbosity level

Post by Pagnon David » Tue Nov 07, 2023 3:44 pm

Thabks Nick, it makes sense!

POST REPLY