jasi.simple.defi
Class SimpleMovingElement

java.lang.Object
  extended by jasi.sim.basic.value.AbstractSimValueType
      extended by jasi.sim.basic.value.AbstractComparableObject<Element>
          extended by jasi.sim.basic.element.AbstractElementBean
              extended by jasi.simple.defi.SimpleMovingElementHandler
                  extended by jasi.simple.defi.SimpleMovingElement
All Implemented Interfaces:
Element, SimObject, ExtendedComparable<Element>, SimValue, Movable, java.io.Serializable, java.lang.Comparable<Element>

public class SimpleMovingElement
extends SimpleMovingElementHandler

An example for a simple element.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface jasi.sim.basic.element.Element
COMPARATOR
 
Constructor Summary
SimpleMovingElement()
          Constructor for SimpleMovingElement.
SimpleMovingElement(Id id)
          Constructor for SimpleMovingElement for a given ID.
 
Method Summary
 Element delete()
          Delete this simple element.
 boolean hasTrack()
          Check, if element has a following track.
 Move location(Time time)
          Retrieve location of this simulation element at that simulation time.
 void move(SpaceVec[] track, Speed speed)
          Start movement for this element.
 boolean moving()
          Request, if the actual movement has been started.
 void start()
          Start the movement.
 void stop()
          Stop the movement.
 Time timeToNextLocation()
          Request time for the next update of movement.
 void updateMove()
          Update the actual movement.
 
Methods inherited from class jasi.simple.defi.SimpleMovingElementHandler
getMove, getSpeed, getTrack, getTrack, setMove, setSpeed, setTrack, setTrack, toString
 
Methods inherited from class jasi.sim.basic.element.AbstractElementBean
acceptDelete, compareTo, elements, equals, get, getId, getKey, hashCode, isDeleted, registered, set, setId, setKey
 
Methods inherited from class jasi.sim.basic.value.AbstractComparableObject
isEQ, isGE, isGT, isLE, isLT, isNE
 
Methods inherited from class jasi.sim.basic.value.AbstractSimValueType
getContent
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jasi.sim.basic.element.Element
getKey, isDeleted, registered, setKey
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface jasi.sim.basic.id.SimObject
getId, setId
 

Constructor Detail

SimpleMovingElement

public SimpleMovingElement()
Constructor for SimpleMovingElement.


SimpleMovingElement

public SimpleMovingElement(Id id)
Constructor for SimpleMovingElement for a given ID.

Parameters:
id - The ID.
Method Detail

delete

public Element delete()
Delete this simple element.

Specified by:
delete in interface Element
Overrides:
delete in class AbstractElementBean
Returns:
The deleted element.
See Also:
AbstractElementBean.delete()

location

public Move location(Time time)
Retrieve location of this simulation element at that simulation time.

Parameters:
time - That simulation time.
Returns:
The location at that time.

timeToNextLocation

public Time timeToNextLocation()
Request time for the next update of movement. This will be the time which is required to arrive at the target of the actual move.

Returns:
The next update time.

updateMove

public void updateMove()
Update the actual movement. This method will change the target of movement to the next location in its track.


move

public void move(SpaceVec[] track,
                 Speed speed)
Start movement for this element.

Parameters:
track - The track for the movement.
speed - The speed of movement.

start

public void start()
Start the movement.


stop

public void stop()
Stop the movement.


moving

public boolean moving()
Request, if the actual movement has been started.

Returns:
True, if movement has been started; otherwise false, when stopped.

hasTrack

public boolean hasTrack()
Check, if element has a following track.

Returns:
True, if following track exists.