Little design problem: sleep and quasi parallelism
Imagine I have in the simulation a robot and some kind of commando-machine. The commando-machine gets a bunch of commands and calculations which can have a side effect n the robot, so that it shall move etc. So basically the call to evaluate the bunch of commandos within the commando machine is a blocking method call.
One of those commands can be to pause the processing of the commands. The problem is that a normal call to "sleep" pauses the whole simulation but I need that the actions of the robot continue. An example:
The command machine calculates some things and then sets the velocity of one joint of the robot, so that the joint is moving. Now a pause command approaches, which shall pause the command processing but the joint shall keep moving. Within a high level language this would be solved with threads (or less common: a nice designed scheduler..).
I am searching for a tricky way to solve this problem serially. Every tip is welcome.

Little design problem: sleep and quasi parallelism
i might not be fully understanding this but your saying you want to issue a command from a extract object to a multibody object , but you want a wait command?so one object can be "paused" without pausing the other object?
I think the way i would do this is to have the multibody as its own class, but have the command thing not as a object but in the main iteratoin method. then you can have a varible called sleep,and have a if statement before the command code saying if present time > old time +sleep then do command if not dont , that should achive what you want. there might be a better way of doing it with this logic though but its late, i'll have anouther think in the morning.
Little design problem: sleep and quasi parallelism
Vague the way you descibe it is the only one I see. The thing that disappoints me is that the whole design gets worse with that. My command interpreter (StackMachine) is in its own class. Every call to StackMachine's evaluate proceeds the whole command bunch and returns a result (its GP ..). But instead of using one call I have to do something like:
Controller class:
+to iterate method:
do a robot command (only a time slice of it)
StackMachine evaluate ONE step
take result:
do I have to assume I have to sleep?
call next evaluation step after x ms.
With that way a number of little problems occur. E.g. that I have to take a return value (or more bad: a globale variable..) marking that iterate has to pause with calling the StackMachine's evaluate. This is because if the evaluation for one bunch ends it can return _any_ result.
Little design problem: sleep and quasi parallelism
Have you tried using the event scheduler? Just have each command wait until a time or event has been reached, then continue.
~Moto
Little design problem: sleep and quasi parallelism
If it may help...
I'm not sure I get the hole idea either, I assume that you have a Comando class responsible of command interpretation and of the impact of commands on robots, and one or several Robot classes responsible of themselves and making the world alive...
If I understand your need, you might consider having the Comando class have its own iterate method. Also, have the Comando class have a boolean variable to define if it is asleep or not. The itterate method interprets command, if the sleeping state is true, do nothing. Otherwise, interpret command and do whatever must be done.
When it falls on the "go to sleep for x ticks" command, you set the sleeping state to true, and, as Moto suggested, use the controller scheduler to trigger off the sleeping state with a callback method after the corresponding time.
Cheers!