
// Counter.java
// Andrew Davison, Nov 2018, ad@fivedots.coe.psu.ac.th

/* Provide a counter for a participant in the simulation.

 * This includes an identifying string and a count of how
 * many participants of this type currently exist within 
 * the simulation.
 * 
 * @author David J. Barnes and Michael Kolling
 * @version 2006.03.30

   Unchanged from version 1.
 */


public class Counter
{
  private String name; // simulation participant name
  private int count; // How many of this type exist in the simulation


  public Counter(String nm)
  { name = nm;
    count = 0;
  }
    
  public String getName()
  {  return name; }

  public int getCount()
  {  return count;  }

  public void increment()
  {  count++;  }
    
  public void reset()
  {  count = 0; }

}  // end of Counter class
