Class AbstractWeightedArrayFunction

java.lang.Object
microsim.statistics.functions.AbstractFunction
microsim.statistics.weighted.functions.AbstractWeightedArrayFunction
All Implemented Interfaces:
EventListener, IUpdatableSource
Direct Known Subclasses:
Weighted_MeanArrayFunction, Weighted_SumArrayFunction

@Deprecated(forRemoval=true) public abstract class AbstractWeightedArrayFunction extends AbstractFunction
Deprecated, for removal: This API element is subject to removal in a future version.
unnecessary with microsim.dev.statistics
This class represents the skeleton for all the function which operate on array of native data type values, appropriately weighted by weights specified in a corresponding array of doubles. Each inheriting class automatically implements the IUpdatableSource and the ISimEventListener, which are managed by the AbstractWeightedArrayFunction.

Title: JAS-mine

Description: Java Agent-based Simulation library. Modelling in a Networked Environment

Copyright (C) 2017 Michele Sonnessa and Ross Richardson

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
Author:
Michele Sonnessa and Ross Richardson
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Fields inherited from class AbstractFunction

    timeChecker
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a function on a double array source.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a function on a float array source.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a function on an integer array source.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a function on a long array source.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    apply(double[] data, double[] weights)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Apply the function on a the given array of double values.
    void
    apply(float[] data, double[] weights)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Apply the function on a the given array of float values.
    void
    apply(int[] data, double[] weights)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Apply the function on a the given array of integer values.
    void
    apply(long[] data, double[] weights)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Apply the function on a the given array of long values.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Force the function to update itself.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • TYPE_DBL

      protected static final int TYPE_DBL
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • TYPE_FLT

      protected static final int TYPE_FLT
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • TYPE_INT

      protected static final int TYPE_INT
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • TYPE_LNG

      protected static final int TYPE_LNG
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • dblSource

      protected IWeightedDoubleArraySource dblSource
      Deprecated, for removal: This API element is subject to removal in a future version.
    • fltSource

      protected IWeightedFloatArraySource fltSource
      Deprecated, for removal: This API element is subject to removal in a future version.
    • intSource

      protected IWeightedIntArraySource intSource
      Deprecated, for removal: This API element is subject to removal in a future version.
    • lngSource

      protected IWeightedLongArraySource lngSource
      Deprecated, for removal: This API element is subject to removal in a future version.
    • type

      protected int type
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • AbstractWeightedArrayFunction

      public AbstractWeightedArrayFunction(IWeightedDoubleArraySource source)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a function on a double array source.
      Parameters:
      source - The data source.
    • AbstractWeightedArrayFunction

      public AbstractWeightedArrayFunction(IWeightedFloatArraySource source)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a function on a float array source.
      Parameters:
      source - The data source.
    • AbstractWeightedArrayFunction

      public AbstractWeightedArrayFunction(IWeightedIntArraySource source)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a function on an integer array source.
      Parameters:
      source - The data source.
    • AbstractWeightedArrayFunction

      public AbstractWeightedArrayFunction(IWeightedLongArraySource source)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a function on a long array source.
      Parameters:
      source - The data source.
  • Method Details

    • applyFunction

      public void applyFunction()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Force the function to update itself. If the data source implements the IUpdatableSource interface it is updated before reading data.
      Specified by:
      applyFunction in class AbstractFunction
    • apply

      public void apply(double[] data, double[] weights)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Apply the function on a the given array of double values.
      Parameters:
      data - A source array of values.
      weights - An array of weights.
      Throws:
      UnsupportedOperationException - If the function is not able to work on double data type.
    • apply

      public void apply(float[] data, double[] weights)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Apply the function on a the given array of float values.
      Parameters:
      data - A source array of values.
      weights - An array of weights.
      Throws:
      UnsupportedOperationException - If the function is not able to work on double data type.
    • apply

      public void apply(int[] data, double[] weights)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Apply the function on a the given array of integer values.
      Parameters:
      data - A source array of values.
      weights - An array of weights.
      Throws:
      UnsupportedOperationException - If the function is not able to work on double data type.
    • apply

      public void apply(long[] data, double[] weights)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Apply the function on a the given array of long values.
      Parameters:
      data - A source array of values.
      weights - An array of weights.
      Throws:
      UnsupportedOperationException - If the function is not able to work on double data type.