Class Particle


  • public class Particle
    extends java.lang.Object
    The public particle class, currently used by the Optimizer.
    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Ilge Akkaya
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (cxh)
    • Constructor Summary

      Constructors 
      Constructor Description
      Particle​(int size)
      Construct a Particle.
      Particle​(Particle p)
      Construct a Particle.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean adjustWeight​(double w)
      Adjust the weight.
      int getSize()
      Return the size of the partile.
      java.util.List<java.lang.Double> getValue()
      Return the value.
      double getWeight()
      Return the weight.
      void setValue​(java.util.LinkedList<java.lang.Double> l)
      Set the value.
      void setWeight​(double weight)
      Set the weight.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Particle

        public Particle​(int size)
        Construct a Particle.
        Parameters:
        size - The size of the particle
      • Particle

        public Particle​(Particle p)
        Construct a Particle.
        Parameters:
        p - The particle
    • Method Detail

      • adjustWeight

        public boolean adjustWeight​(double w)
        Adjust the weight. If w is greater than 0.0, then the weight is set to weight/w.
        Parameters:
        w - The weight.
        Returns:
        true if the weight was adjusted.
      • getSize

        public int getSize()
        Return the size of the partile.
        Returns:
        The size.
      • getValue

        public java.util.List<java.lang.Double> getValue()
        Return the value.
        Returns:
        The value.
        See Also:
        setValue(LinkedList)
      • getWeight

        public double getWeight()
        Return the weight.
        Returns:
        the weight.
        See Also:
        setWeight(double)
      • setValue

        public void setValue​(java.util.LinkedList<java.lang.Double> l)
        Set the value.
        Parameters:
        l - The value
        See Also:
        getValue()
      • setWeight

        public void setWeight​(double weight)
        Set the weight.
        Parameters:
        weight - the weight.
        See Also:
        getWeight()