Changeset 820

Show
Ignore:
Timestamp:
02/23/10 10:16:46 (14 years ago)
Author:
smidl
Message:

Dorpava Zlicin

Location:
applications/doprava
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • applications/doprava/CMakeLists.txt

    r814 r820  
    1616add_subdirectory (aimsun_bdm) 
    1717link_directories (./aimsun_bdm) 
     18 
     19add_library(traffic_agents traffic_agent.cpp traffic_agent.h) 
    1820# executable 
    19 EXEC(main_loop aimsun_bdm) 
     21EXEC(main_loop traffic_agents aimsun_bdm) 
    2022 
  • applications/doprava/Zlicin.cfg

    r819 r820  
    1 agents = { 
    2 { // agent 1 
     1agents = ( 
     2        { // agent 1 
    33        class = "BaseTrafficAgent"; 
    4   name = "495"; 
    5   sg = { 
    6     { name = "VA"; 
    7       detectors = { 
    8         { name = "DVA1"; 
    9           distance = 10; 
    10         }, {name = "DVA"; 
    11           distance = 20; 
    12         }; 
    13       }; 
    14     },  
    15     { name = "VB"; 
    16       detectors = { }; 
    17       input = {}; 
    18       output = {}; 
    19     } 
    20   }; 
    21   input = { // remote detectors  
     4          name = "495"; 
     5          sg = ( 
     6            { name = "VA"; 
     7              detectors = ( 
     8                        { name = "DVA1";  distance = 10;},  
     9              {name = "DVA";  distance = 20; } 
     10              ); 
     11            },  
     12            { name = "VB"; 
     13              detectors = (); 
     14              input = {}; 
     15              output = {}; 
     16            }); 
     17  input = ( // remote detectors  
    2218    { 
    2319      name = "601DVA1"; 
    2420                distance = 100; 
    25       to = {"VC","VD"}; 
     21      to = ("VC","VD"); 
    2622    }, 
    2723    { 
    2824      name = "601DVA"; 
    2925                distance = 100; 
    30       to = {"VC","VD"}; 
     26      to = ("VC","VD"); 
    3127    } 
    32   }; 
    33   output = { //  
     28  ); 
     29  output = ( //  
    3430     { 
    35       from = "VC"; 
     31      from = ("VC"); 
    3632                detector ="495DVC"; 
    3733      to = "601"; 
    3834      } 
    39   }; 
     35  ); 
    4036 
    4137  offset = 40; //s 
    4238}, 
    43 { // agent 2 
     39{ //agent 2 
    4440        class = "BaseTrafficAgent"; 
    4541  name = "601"; 
    46   sg = { 
     42  sg = ( 
    4743    { name = "VA"; 
    48       detectors = { 
    49         { name = "DVA1"; 
    50           distance = 10; 
    51         }, {name = "DVA"; 
    52           distance = 20; 
    53         }; 
    54       }; 
     44      detectors = ( 
     45                { name = "DVA1"; distance = 10; },  
     46                 {name = "DVA"; distance = 20; } 
     47      ); 
    5548    },  
    5649    { name = "VB"; 
    57       detectors = { }; 
     50      detectors = (); 
    5851    } 
    59   }; 
     52  ); 
    6053   
    6154  offset = 60; //s 
    62  
     55        input = (); 
     56        output = (); 
    6357} 
    64 }; 
     58); 
  • applications/doprava/traffic_agent.cpp

    r819 r820  
    1010} 
    1111 
    12 void ARXAgent::from_setting(const libconfig::Setting& set) 
     12void BaseTrafficAgent::from_setting(const Setting& set) 
    1313{ 
    1414    bdm::Participant::from_setting(set); 
    1515         
    16          
     16        UI::get(sg,set,"sg", UI::compulsory); 
     17        UI::get(requests,set,"output",UI::compulsory); 
    1718} 
  • applications/doprava/traffic_agent.h

    r819 r820  
    1818                string name;             //! detector name 
    1919                int distance;                //! distance from stop-line 
     20                RV rv; 
    2021                //! function loading info from Setting 
    2122                void from_setting(const Setting &set){ 
    2223                        UI::get(name,set,"name",UI::compulsory); 
    2324                        UI::get(distance,set,"distance",UI::compulsory); 
     25                         
    2426                } 
    2527}; 
     
    184186                                sgh(i).ds2data.filldown(glob_dt, sgh(i).det_data); 
    185187                        } 
    186                         // copy sg_length ... 
     188                        // copy sg_length ... and others... 
    187189                } 
    188190                void act(vec &glob_ut){ 
     
    202204                } 
    203205                 
    204                 void from_setting(const Setting &set){}; 
     206                void from_setting(const Setting &set); 
    205207}; 
    206208UIREGISTER(BaseTrafficAgent);