20 import java.util.Vector;
22 import ca.uqac.lif.cep.functions.UnaryFunction;
34 public static final GetPosition
getPos =
new GetPosition();
39 public static final GetVelocity
getVel =
new GetVelocity();
44 public static final GetAngle
getAngle =
new GetAngle();
67 public RobotEvent(Vector<Float> position, Vector<Float> velocity,
float theta)
70 m_position = position;
71 m_velocity = velocity;
103 public String toString()
105 StringBuilder out =
new StringBuilder();
106 out.append(
"\u27e8");
107 out.append(
"p:").append(m_position).append(
",");
108 out.append(
"v:").append(m_velocity).append(
",");
109 out.append(
"p\u03b8:").append(m_theta);
110 out.append(
"\u27e9");
111 return out.toString();
117 @SuppressWarnings(
"rawtypes")
118 public static class GetPosition
extends UnaryFunction<RobotEvent,Vector>
132 public GetPosition duplicate(
boolean with_state)
138 public String toString()
147 @SuppressWarnings(
"rawtypes")
148 public static class GetVelocity
extends UnaryFunction<RobotEvent,Vector>
162 public GetVelocity duplicate(
boolean with_state)
168 public String toString()
177 public static class GetAngle
extends UnaryFunction<RobotEvent,Float>
191 public GetAngle duplicate(
boolean with_state)
197 public String toString()
Vector< Float > getVelocity()
Gets the velocity of the robot.
static final GetPosition getPos
Static reference to the function GetPosition.
static final GetAngle getAngle
Static reference to the function GetAngle.
final Vector< Float > m_velocity
A vector indicating the velocity of the robot.
final Vector< Float > m_position
A vector indicating the position of the robot.
final float m_theta
The the angle of orientation of the robot (in radians).
static final GetVelocity getVel
Static reference to the function GetVelocity.
Event representing the status of a fictional robot that moves in a two-dimensional space...
RobotEvent(Vector< Float > position, Vector< Float > velocity, float theta)
Creates a new robot event.
Vector< Float > getPosition()
Gets the position of the robot.
float getOrientation()
Gets the angle of orientation of the robot.