source: tmcsimulator/branches/ATMSDriver/src/atmsdriver/network/model/LoopDetector.java @ 75

Revision 75, 1.2 KB checked in by jtorres, 9 years ago (diff)

Renamed fep_client_cpp to ATMSCommunicator, and upgraded it to cpp from straight c. Converted/Renamed? fep_client_java to ATMSDriver NetBeans? project, and checked in initial code for ATMSDriver. It contains the skeleton network model and a NetworkReader? which loads static network data from network lookup files.

Line 
1package atmsdriver.network.model;
2
3import java.util.ArrayList;
4import java.util.List;
5
6/** A LoopDetector represents a single detector for a single lane in a network.
7 *
8 *  A LoopDetector contains static meta data, and three dynamic attributes: vol,
9 *  occ, and spd.
10 *
11 * @author John A. Torres
12 * @version 09/10/2017
13 */
14public class LoopDetector 
15{
16    /* static data */
17    final private int loopID;
18    final private String loopLocation;
19    final private int laneNum;
20   
21    /* dynamic data */
22    private int vol;
23    private int occ;
24    private int spd;
25   
26    public LoopDetector(int loopID, String loopLocation, int laneNum)
27    {
28        /* Set static data */
29        this.loopID = loopID;
30        this.loopLocation = loopLocation;
31        this.laneNum = laneNum;
32       
33        /* Init dynamic data */
34        this.vol = 0;
35        this.spd = 0;
36        this.occ = 0;
37    }
38   
39    /**
40     * Updates loop detector dynamic attributes.
41     * @param vol volume
42     * @param occ occupancy
43     * @param spd speed
44     */
45    public void updateLoop(int vol, int occ, int spd)
46    {
47        this.vol = vol;
48        this.occ = occ;
49        this.spd = spd;
50    }
51}
Note: See TracBrowser for help on using the repository browser.