//Provide initial state(flowrate) to agent
        public static Dictionary <string, double> vissimState(int count, int run_times, int[] action) //SimPeriod * SimRes
        {
            Set_AllDesireSpeed(action);
            double flowrate = 0.0;
            double density  = 0.0;

            for (int i = 0; i < run_times; i++)
            {
                VissimTools.RunSingleStep();
            }
            //  int interval_num = (int)(run_times / (SimRes * DataCollectionInterval) * count + 1);
            int datapoint1_vehs = VissimTools.Get_CurrentDataCollectionResult_Vehs(1);

            flowrate = VissimTools.Get_FlowRate(datapoint1_vehs, DataCollectionInterval);

            int    num_lanes    = VissimTools.Get_NumLaneByVehTravelTm(2);
            int    travelTm_vhs = Get_CurrentVehicleTravelTime_Vehs(2);
            double distance     = Get_CurrentVehicleTravelTime_DistTrav(2);
            int    time         = Get_CurrentVehicleTravelTime_TravTm(2);

            density = Get_Density(travelTm_vhs, DataCollectionInterval, time, distance, num_lanes);

            Dictionary <string, double> result = new Dictionary <string, double>();

            result.Add("flowrate", flowrate);
            result.Add("density", density);

            return(result);
        }
        public static double vissimReward(int run_times, int[] actions) //SimPeriod * SimRes
        {
            Set_AllDesireSpeed(actions);
            double Reward = 0;

            for (int i = 0; i < run_times; i++)
            {
                VissimTools.RunSingleStep();
            }

            int datapoint4_vehs = VissimTools.Get_CurrentDataCollectionResult_Vehs(4);

            Reward = VissimTools.Get_FlowRate(datapoint4_vehs, DataCollectionInterval);
            // int density = VissimTools.Get_Density(int num_vehs, int timeinterval, double speed, double distance, int num_lane)
            return(Reward);
        }