Generalisation of function

How can I generalize pendulumManagement() to take as arguments the names of the functions to fire and the boolean to decide on?

void pendulumManagement()
{
  if (pendul) {
    singlePendulumManagement();
  } else {
    dublePendulumManagement();
  }
}

Sounds like you want reflection.

In Java you would use a Class as argument and then call a class method depending on the boolean

How can I do it in processing?

I think you need to do a bit of homework by yourself too.

You’d need a base class (pendulum) that has methods
singlePendulumManagement() and dublePendulumManagement(). It can be an interface too. Then you’ll extend that base class (or interface) to classes that have different implementations of those functions.

Function call could be like this
void pendulumManagement(BaseClass bc, boolean pendul)

Reflections should work but they’re not easy. I do however have some code I can share.