public static void main(String args[]) {

        try {

            // create the lp_solver
            RampMeteringSolver solver = new RampMeteringSolver(config, K_dem_seconds, K_cool_seconds, eta, sim_dt_in_seconds,solver_type,true);

            // populate state link ids
            ml_link_ids.addAll(solver.get_mainline_ids());

            // open output writer
            batch_data = new BatchWriter(outfile_prefix.concat(".txt"));
            ResultPrinterEachRun lp_results_printer = print_details ?  new ResultPrinterEachRun(outfile_prefix) : null;

            // write solver parameters
            solver.write_parameters_to_matlab(outfile_prefix);

            // initial conditions on a grid
            ArrayList<ArrayList<Double>> all_ic = collect_initial_conditions(grid_file, solver.getFwy());

            // gurobi needs it solved initially for rhs override to work.
            RampMeteringSolution x = solver.solve();

            int index = 0;
            for (ArrayList<Double> ic : all_ic) {
                index += 1;
                System.out.println(index + " of " + all_ic.size());

                // check
                if(ml_link_ids.size()!=ic.size())
                    throw new Exception("ic not same size as ml_ids");

                // set initial condition
                for (int i = 0; i < ml_link_ids.size(); i++)
                    solver.set_density_in_veh(ml_link_ids.get(i), ic.get(i));

                // run solver
                RampMeteringSolution sol = solver.solve();

                // check ctm-ness
                Double CTMcheck = sol.get_max_ctm_distance() == null ? -1d : sol.get_max_ctm_distance();

                // write output
                batch_data.write(batch_data.getTableString(index, ic, or_demand_vps, CTMcheck, sol.get_tvh(), sol.get_tvm(),sol.get_cost()));
                if(print_details)
                    lp_results_printer.print_lp_results(sol, sol.K, index);
            }

            if(print_details)
                lp_results_printer.print_config_data(solver.getFwy());

        } catch (Exception e) {
            System.err.print(e);
        } finally {
            batch_data.close();
        }


    }