public class Balance extends Behavior implements IBaseWalk
Constructor and Description |
---|
Balance(IThoughtModel thoughtModel,
ParameterMap params)
Instantiates and initializes a new Balance behavior object
|
Balance(java.lang.String name,
IThoughtModel thoughtModel,
ParameterMap params)
Instantiates and initializes a new Balance behavior object
|
Modifier and Type | Method and Description |
---|---|
void |
init()
Reinitializes the Behavior-StateMachine (if present)
|
boolean |
isFinished()
Check if this behavior is finished performing
|
void |
morphing(Balance source)
Morphes from one Balance-Behavior to another
|
void |
perform()
Main method called to perform the behavior
|
void |
setAngle(double turnLeftRight)
Set angel for Orientation (max: 30; min: -30)
|
void |
setDesiredSpeed(double speed)
Set forwards or backwards speed in percent. (-100% .. -100%)
|
void |
setDirection(double direction)
Set Direction in percent (-100 .. 100)
|
void |
setMovement(double speed,
double direction,
double angle,
boolean ignoreNextCall,
double maxSpeedForward) |
void |
setMovement(double speed,
double direction,
double angle,
double maxSpeedForward,
boolean hurry)
Instrumentation for the walk
|
IBehavior |
switchFrom(IBehavior actualBehavior)
Decide if it is possible to switch to this behavior from the current
behavior.
|
abort, getConsecutivePerforms, getIntensity, getName, getPerforms, getRootBehavior, getSuccessfulPerforms, getUnsuccessfulPerforms, onLeavingBehavior, reload, setIntensity, setName, stayIn, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
abort, getConsecutivePerforms, getIntensity, getName, getPerforms, getRootBehavior, getSuccessfulPerforms, getUnsuccessfulPerforms, onLeavingBehavior, reload, setIntensity, stayIn
public Balance(IThoughtModel thoughtModel, ParameterMap params)
thoughtModel
- Reference to the thought model objectparams
- Behavior parameterspublic Balance(java.lang.String name, IThoughtModel thoughtModel, ParameterMap params)
name
- name of the BehaviorthoughtModel
- Reference to the thought model objectparams
- Behavior parameterspublic void init()
IBehavior
public boolean isFinished()
IBehavior
isFinished
in interface IBehavior
isFinished
in class Behavior
public void perform()
public void setAngle(double turnLeftRight)
turnLeftRight
- values >0 means right turn; <0 left turnpublic void setDesiredSpeed(double speed)
speed
- values (forward > 0 > backward)public void setDirection(double direction)
direction
- values (right > 0 > left)public IBehavior switchFrom(IBehavior actualBehavior)
IBehavior
switchFrom
in interface IBehavior
switchFrom
in class Behavior
actualBehavior
- the currently/actually performed behaviorpublic void setMovement(double speed, double direction, double angle, double maxSpeedForward, boolean hurry)
IBaseWalk
setMovement
in interface IBaseWalk
speed
- the desired forward speeddirection
- the desired side wise speedangle
- the desired turn angleignoreNextCall
- true if the next call to this method should be
ignoredpublic void setMovement(double speed, double direction, double angle, boolean ignoreNextCall, double maxSpeedForward)
public void morphing(Balance source)
source
- Behavior from which to take the values for the morphing