Show
Ignore:
Timestamp:
02/24/10 00:56:13 (14 years ago)
Author:
smidl
Message:

aimsunDS minor correction + improvements in Agents

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • applications/doprava/traffic_agent.cpp

    r820 r840  
    1414    bdm::Participant::from_setting(set); 
    1515         
     16        // load from file 
    1617        UI::get(sg,set,"sg", UI::compulsory); 
    1718        UI::get(requests,set,"output",UI::compulsory); 
     19        Array<DetectorIn> det_in; 
     20        UI::get(det_in, set, "input",UI::compulsory); 
     21         
     22        // process sg == create handles 
     23        sgh.set_length(sg.length()); 
     24        for(int i=0;i<sg.length();i++){ 
     25                sgh(i).connect_sg(sg(i),name); 
     26        } 
     27         
     28        // process output == handles 
     29        request_handler.set_length(requests.length()); 
     30        for(int i=0;i<requests.length();i++){ 
     31                request_handler(i).connect_request(requests(i),name); 
     32                output_rv.add(request_handler(i).rv); 
     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         
     47        // process DetIn - create input 
     48        for (int i=0; i<det_in.length(); i++){ 
     49                input_rv.add(RV(det_in(i).name,2)); 
     50        } 
     51        input_data.set_size(input_rv._dsize()); 
    1852}