Class DrawLayersIsolines

  • All Implemented Interfaces:
    it.unibo.alchemist.boundary.swingui.effect.api.DrawLayers , it.unibo.alchemist.boundary.swingui.effect.api.Effect , it.unibo.alchemist.boundary.swingui.effect.api.FunctionDrawer , java.io.Serializable

    
    public abstract class DrawLayersIsolines
    extends DrawLayersValues
                        

    Draw layers isolines. The user must specify: - the number of isolines to draw - the min layer value - the max layer value - the distribution, used to space isoline values between min and max This class defines the drawFunction method, which is capable of drawing a layer's isolines given a function. The only responsibility left to subclasses is to provide a LayerToFunctionMapper.

    • Constructor Detail

      • DrawLayersIsolines

        DrawLayersIsolines(IsolinesFinder algorithm, LayerToFunctionMapper mapper)
        Every class extending this one should call this constructor.
        Parameters:
        algorithm - - the algorithm used to extract isolines
        mapper - - the function converting a layer to a function
    • Method Detail

      • getDrawValues

         Boolean getDrawValues()
        Returns:

        whether the values of the isolines are to be drawn or not

      • setDrawValues

         void setDrawValues(Boolean drawValues)
        Parameters:
        drawValues - whether the values of the isolines are to be drawn or not
      • logspace

         static Array<double> logspace(double d1, double d2, int n, double base)

        generates n logarithmically-spaced points between d1 and d2 using the provided base.

        Parameters:
        d1 - The min value
        d2 - The max value
        n - The number of points to generated
        base - the logarithmic base to use
        Returns:

        an array of lineraly space points.

      • linspace

         static Array<double> linspace(double d1, double d2, int n)

        generates n linearly-spaced points between d1 and d2.

        Parameters:
        d1 - The min value
        d2 - The max value
        n - The number of points to generated
        Returns:

        an array of lineraly space points.