root/applications/doprava/traffic_agent.cpp @ 927

Revision 927, 1.0 kB (checked in by smidl, 14 years ago)

traffic agents -- pro BDM > r904

Line 
1#include "traffic_agent.h"
2
3void LaneHandler::connect_data(BaseTrafficAgent& agent0)
4{
5        agent = &agent0;
6        agentin2input.set_connection(rv_inputs, agent->rv_inputs);
7        ivec queue_index_tmp = agent->rv_queues.dataind(rv_queue);
8        if (queue_index_tmp.length()==1){
9                queue_index=queue_index_tmp(0);
10        } else {
11                bdm_error("queue " + lane.queue + " not found");
12        }               
13}
14
15double LaneHandler::expected_output(double green_time){
16        agentin2input.filldown(agent->inputs, inputs);
17        queue = agent->queues(queue_index);
18       
19        double exp_output=0.0;
20        /////////
21       
22       
23        ////////
24        return exp_output;
25}
26
27
28void BaseTrafficAgent::from_setting(const Setting& set)
29{
30    bdm::Participant::from_setting(set);
31       
32        // load from file
33        if (set.exists("lanes")){
34                Setting &Slanes=set["lanes"];
35                lanes.set_length(Slanes.getLength());
36                for(int l=0; l<lanes.length(); l++){
37                        lanes(l).from_setting(Slanes[l]);
38                }
39        }
40        //UI::get(lanes,set,"lanes", UI::compulsory);
41        UI::get(neighbours, set, "neighbours", UI::optional);
42}
Note: See TracBrowser for help on using the browser.