Class Ball

java.lang.Object
com.molecular_java.Ball

public class Ball extends Object
The class represents balls/particles in the system, so each balls is an object of this class.
  • Field Details

    • diameter

      public Double diameter
      Diameter of the ball.
    • weight

      public Double weight
      Weight of the ball.
    • coordinates

      public Double[] coordinates
      Position of the ball.
    • type

      public char type
      Type of the ball (e.g. amino acid type / HP in a HP model)
    • code

      public int code
      Code for indexing.
  • Constructor Details

    • Ball

      public Ball(Random random, double diam, Hashtable<Character,Integer> aaCodes, char type_in)
      The basic constructor which makes an object of class Ball accordingly to the SimulationBox properties and sets its diameter.
      Parameters:
      random - Random object to set coordinates
      diam - diameter of the ball
      aaCodes - a dictionary of codes and values of types
      type_in - type of newly forming AA ball
    • Ball

      public Ball(Ball ball)
      This constructor is used to make a copy of given ball.
      Parameters:
      ball - the new ball will be copy of
    • Ball

      public Ball(Double[] centerOfMass)
      Makes a "ball" representation of the center of mass in the system. Used in RadiusOfGyration(SimSpace s)
      Parameters:
      centerOfMass - to put a ball on a right position.
    • Ball

      public Ball()
      Only for testing.