source: tmcsimulator/branches/green_dot/network_factory.cpp @ 165

Revision 165, 2.0 KB checked in by jtorres, 9 years ago (diff)

green_dot now has datapacking implemented

Line 
1#include "network.h"
2#include "DataPacker.h"
3#include <vector>
4#include <math.h>
5#include <stdio.h>
6#include <string.h>
7#include <cstdlib>
8
9
10// TEST DATA
11// lds_id       line    drop sch lineinfo       system_key      sch_seq glo_seq         count   freeway Dir     ca_pm   lds_name               
12// 1203103      50      13      13      13      1123005873      24148   1357650         19      55      S       6.88    MACARTHU1
13FEP_LINE_LDS * load_lines(int *size, const char * fName)
14{
15        FEP_LINE_LDS *lines = (FEP_LINE_LDS *) calloc(sizeof(FEP_LINE_LDS), 1);
16        *size = 1;
17        lines[0].lineNum = 50;
18        lines[0].lds.push_back(1203103);
19        lines[0].ldsIndex.push_back(0);
20        lines[0].ldsNum = 1;
21        lines[0].count = 19;
22        lines[0].schedule = 13;
23        lines[0].globalSeq = 1357650;
24        lines[0].schedleSeq = 24148;
25        return lines;   
26}
27
28// TEST DATA
29//FWY   Dir     POSTMI  LDS_ID  VDS_ID  LOOP_ID LOC    LANE LOOP_LOC            PARAMICS_NAME  PARAMICS_LANE   
30//55    S       6.88    1203103 1203104 1203105 QU      1       QUEUE           55s6.88ora      0
31
32//55    S       6.88    1203103 1203104 1203106 DM      2       DEMAND          55s6.88ora      0
33
34//55    S       6.88    1203103 1203104 1203107 PA      3       PASSAGE         55s6.88ora      0
35
36//55    S       6.88    1203103 1203108 1203109 HV      1       SD_1            ?               0
37
38//55    S       6.88    1203103 1203110 1203111 ML      1       ML_1            55s6.88ml       4
39
40//55    S       6.88    1203103 1203110 1203112 ML      2       ML_2            55s6.88ml       3
41
42//55    S       6.88    1203103 1203110 1203113 ML      3       ML_3            55s6.88ml       2
43
44//55    S       6.88    1203103 1203110 1203114 ML      4       ML_4            55s6.88ml       1
45STATION * load_lds(const char * fName)
46{
47        /* Read loop meta data */
48        STATION *lds_map = (STATION *) calloc(sizeof(STATION), 1);
49        lds_map[0].lds = 1203103;
50        lds_map[0].line_num = 50;
51        lds_map[0].drop = 13;
52        lds_map[0].num = 1;
53
54   LOOP *loop = new LOOP;
55   loop->loopID = 1203113;
56   loop->loop_loc = "ML_3";
57   loop->vol = 40;
58   loop->occ = 10;
59   loop->spd = 10;
60   
61   lds_map[0].loops.push_back(loop);
62   
63        // Init Loop dataPack
64        lds_map[0].length = lds_map[0].num * 2 + CONTROL_DATA_LEN;
65
66   lds_map[0].dataPack = DataPacker::packData(&lds_map[0]);
67
68        lds_map[0].pos = 0;
69
70        lds_map[0].MlTotVol = 150;
71        lds_map[0].OppTotVol = 150;
72
73        return lds_map;
74}
Note: See TracBrowser for help on using the repository browser.