package atmsdriver.network.model;

import java.util.ArrayList;
import java.util.List;

/** A LoopDetector represents a single detector for a single lane in a network.
 * 
 *  A LoopDetector contains static meta data, and three dynamic attributes: vol,
 *  occ, and spd.
 *
 * @author John A. Torres
 * @version 09/10/2017
 */
public class LoopDetector 
{
    /* static data */
    final private int loopID;
    final private String loopLocation;
    final private int laneNum;
    
    /* dynamic data */
    private int vol;
    private int occ;
    private int spd;
    
    public LoopDetector(int loopID, String loopLocation, int laneNum)
    {
        /* Set static data */
        this.loopID = loopID;
        this.loopLocation = loopLocation;
        this.laneNum = laneNum;
        
        /* Init dynamic data */
        this.vol = 0;
        this.spd = 0;
        this.occ = 0;
    }
    
    /** 
     * Updates loop detector dynamic attributes.
     * @param vol volume
     * @param occ occupancy
     * @param spd speed
     */
    public void updateLoop(int vol, int occ, int spd)
    {
        this.vol = vol;
        this.occ = occ;
        this.spd = spd;
    }
}
