Global Positioning System Reference
In-Depth Information
Some methods are marked as final , the object-oriented technique for avoid-
ing overriding and also to ensure that all ROs are really using their internal
GPSunit .
The method
final public double getOrientation()
{
return gpsUnit.getDirection();
}
demonstrates how terminology can be adopted for different objects and
contexts.
Speed (velocity) is intentionally not provided externally, since it depends
on the RO's private Position implementation. When you get caught speed-
ing with your car, you can't argue that your speedometer was in the legal
range!
At this point the RO can become any thing, not only a moving thing. Of
course, a building has no speed relative to the ground ( Position=const )
and logging GPS tracks wouldn't make much sense. Yet, the building does
have a location at every point in time, which will be provided by the GPS
unit and can be synchronized with or by the framework.
6.2.1 Every RealObject has a Shape
The Shape provided in the constructor on page 69 refers to the body of the
object. During the project setup, this shape should be kept as simple as
possible. For example, it can be constructed with
public Shape( double length, double width, double height )
For the time being, the three dimensions should describe the outer box of
the object. This is evident for buildings. For busses, the orientation should
be considered in a two- or three-dimensional simulation. For motorcycles,
the outer shape would need dynamic adjustment, since it gets lower and
wider when leaning into a curve. A human body is even more complex:
lying, sitting, standing, running, etc.
6.3 abstract Motion of a RealObject
The RO is created in conjunction with its GPS device to provide a heart-
beat. Then the real object is ready to move (or to be moved). Physically
speaking, any motion is described by the ratio of distance and duration in
a direction. People move by taking one step at a time and accelerate by
increasing the step's lengths and frequency. Motor vehicles are driven by
engines transforming fuel (stored energy) into motion and are directed with
the steering wheel. Every object has a different way to move and makes a
 
Search WWH ::




Custom Search