Global Positioning System Reference
In-Depth Information
The RealObject is a class with a partial implementation and can not be in-
stantiated with the new operator. The protected visibility of the method
move forces every RO programmer to extend the RealObject in order to use
it. Real-world semantics are modeled with the mechanisms of visibility and
class type.
6.3.1 Every RealObject Has Mass and Inertia
The abstract method .move provides a programming shell to supply mo-
tion parameters from the internal behavior. On the outside, observers can
sample traces to validate them against the environment (map) and check
plausibility. In terms of the vision, RO and ROApp programmers see the
real object from different perspectives.
Handling mass and inertia was mentioned earlier (see page 15) and is
discussed in more detail on the website (www.roaf.de) under the heading
\Objects and Physics." A car, just like any mass object, can not simply
set the speed. The move method has to be improved in order to accelerate
and decelerate according to the object's power and mass. Inertia holds the
mass back, while the force pulls it forward. Since the mass is part of the
RealObject , the change of motion can be calculated roughly.
With a set of real traces for a specified vehicle, the acceleration can be
reverse-engineered for different speed ranges. The smallest curve radius in
relationship to speed can be determined. For realistic behavior, according
to the rules of force and inertia, the RO programmer could write a trace
analyzer to identify extreme situations to define the characteristics of the
vehicle and the roads. The simulation could use these vehicle rules for a
realistic drive|on the analyzed roads.
Physically speaking, the observed motion needs to take into account
mass, inertia, and external parameters like surface, weather, etc. For the
implementation of a RaceCar , a programmer might implement the motion
through certain formulas when a user races a car.
Since the external observer (a server application) can only validate how
your object moves without checking the code, the RO programmer can
choose any implementation with which he is comfortable.
Here is a little game you can play to get an understanding of inertia and
change of motion (speed and/or direction) without applying the actual
physical formulas. First, you need a piece of graph paper which will serve
as our Cartesian coordinate system. Draw a racing circuit by hand with a
space between the curbs from three to five squares and a start/finish line
with two black dots representing two race cars.
To start the game, each player can move his car (black dot) one square
forward or along the diagonal to the left or right. The black dots are
connected with vectors (arrows) as in Figure 6.1. For the next move, copy
 
Search WWH ::




Custom Search