Changeset 842
- Timestamp:
- 02/27/10 10:52:01 (15 years ago)
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/doprava/Zlicin.cfg
r840 r842 17 17 input = ( // remote detectors 18 18 { 19 name = "601_DVA 1";19 name = "601_DVAa"; 20 20 distance = 100; 21 21 to_sg = ("VC","VD"); … … 29 29 output = ( // 30 30 { 31 from = ("VC"); 32 detector = "495_DVC"; 31 detectors = ("495_DVC"); 33 32 to = "601"; 34 33 } … … 55 54 offset = 60; //s 56 55 input = (); 57 output = ( );56 output = ({to="495"; detectors=("601_DVAa","601_DVA");}); 58 57 } 59 58 ); 59 logger = {class="memlog"; filename = "zlicin"; maxlen = 1000;}; -
applications/doprava/traffic_agent.cpp
r840 r842 32 32 output_rv.add(request_handler(i).rv); 33 33 } 34 // connect 35 for(int i=0;i<requests.length();i++){ 36 request_handler(i).outdata2out.set_connection(request_handler(i).rv, output_rv); 37 // search teh right section == probably inefficient 38 /* int j; 39 for (j=0;j<sg.length();j++){ 40 if (sg(i).name==requests(i).from){ 41 sgh(i).data2out.set_connection(output_rv, sgh(i).det_data); 42 break; 43 } 44 }*/ 45 } 46 34 47 35 // process DetIn - create input 48 36 for (int i=0; i<det_in.length(); i++){ -
applications/doprava/traffic_agent.h
r840 r842 41 41 public: 42 42 string to; // agent 43 Array<string> from; //detectors43 Array<string> detectors; //detectors 44 44 void from_setting(const Setting &set){ 45 UI::get( from,set,"from",UI::compulsory);45 UI::get(detectors,set,"detectors",UI::compulsory); 46 46 UI::get(to, set, "to", UI::compulsory); 47 47 } … … 72 72 //! link from global measured data 73 73 datalink ds2data; 74 //! link from data to global out_data75 datalink data2out;76 74 public: 77 75 void connect_sg(SignalGroup &sg0, const string &agent_name){ … … 98 96 public: 99 97 RV rv; 100 datalink outdata2out;101 98 public: 102 99 void connect_request(RequestOut &rq0, const string &agent_name){ 103 100 rq=&rq0; 104 for (int i=0;i<rq-> from.length();i++){105 rv.add(RV( agent_name +"_"+ rq->from(i), 2)); //TODO intensity occupancy101 for (int i=0;i<rq->detectors.length();i++){ 102 rv.add(RV(rq->detectors(i), 2)); //TODO intensity occupancy 106 103 } 107 104 } … … 130 127 //! description of broadcast dataind 131 128 RV output_rv; 129 130 //! datalink from DS to output variables 131 datalink ds2output; 132 132 133 133 //! output recepient … … 193 193 // copy from create message 194 194 // create msg with fields {to=..., what=data, rv=..., value = ...} 195 Setting &m_to=msg.add("to",Setting::TypeString); 196 m_to=requests(i).to; 197 Setting &m_what=msg.add("what",Setting::TypeString); 198 m_what="data"; 199 //Setting &m_data=msg.add("data",Setting::TypeGroup); 200 Setting &m_rv=msg.add("rv",Setting::TypeGroup); 201 R.rv.to_setting(m_rv); 202 Setting &m_val=msg.add("value",Setting::TypeGroup); 203 vec val =R.outdata2out.pushdown(output_data); 204 UI::save(val, m_val); 195 UI::save ( requests(i).to, msg, "to"); 196 UI::save ( (string)"data", msg, "what"); 197 UI::save ( &R.rv, msg, "rv"); 198 UI::save(output_data, msg, "value"); 205 199 } 206 200 } … … 210 204 sgh(i).ds2data.filldown(glob_dt, sgh(i).det_data); 211 205 } 206 //copy data fro neighbours 207 ds2output.filldown(glob_dt, output_data); 212 208 // copy sg_length ... and others... 213 209 } … … 222 218 223 219 void ds_register(const DS &ds){ 220 //register ds2output 221 ds2output.set_connection(output_rv, ds._drv()); 222 output_data.set_size(output_rv._dsize()); 224 223 for (int i=0; i<sgh.length(); i++){ 225 224 sgh(i).ds2data.set_connection(sgh(i).rv_det_data, ds._drv()); -
library/bdm/base/bdmbase.cpp
r802 r842 288 288 } 289 289 290 bdm_assert_debug ( res.length() == dsize, "this rv is not fully present in crv!" );290 //bdm_assert_debug ( res.length() == dsize, "this rv is not fully present in crv!" ); 291 291 return res; 292 292