Class GeneratorPositions.RoadPosition.BySpeed

    • Constructor Detail

      • BySpeed

        public BySpeed​(Speed leftSpeed,
                       Speed rightSpeed)
        Constructor.
        Parameters:
        leftSpeed - Speed; desired speed at left side of the road
        rightSpeed - Speed; desired speed at right side of the road
    • Method Detail

      • getValue

        public double getValue​(Speed desiredSpeed)
        Returns the road position (0.0 = right, 1.0 = left).
        Specified by:
        getValue in interface GeneratorPositions.RoadPosition
        Parameters:
        desiredSpeed - Speed; desired speed at the generator
        Returns:
        road position (0.0 = right, 1.0 = left)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object