To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 19f9f8f1 authored by clivings's avatar clivings
Browse files

to RunFilter added cmd line options

parent 471fa843
......@@ -7,18 +7,29 @@ import org.matsim.api.core.v01.population.PopulationWriter;
import org.matsim.core.config.Config;
import org.matsim.core.config.ConfigUtils;
import ch.ethz.matsim.baseline_scenario.config.CommandLine;
import ch.ethz.matsim.baseline_scenario.config.CommandLine.ConfigurationException;
import org.matsim.core.population.PopulationUtils;
import org.matsim.core.population.io.PopulationReader;
import org.matsim.core.scenario.ScenarioUtils;
import ch.ethz.matsim.baseline_scenario.config.CommandLine;
import ch.ethz.matsim.projects.astra_2018_002.mode_choice.SwissDiscreteModeChoiceModule;
public class RunFilters {
static public void main(String[] args) {
static public void main(String[] args) throws ConfigurationException {
CommandLine cmd = new CommandLine.Builder(args) //
.requireOptions("plans-file-path", "output-file-path") //
.build();
// create population data container
Config config = ConfigUtils.createConfig();
Scenario scenario = ScenarioUtils.createScenario(config);
// read original population file
new PopulationReader(scenario).readFile("C:\\Users\\clivings\\Documents\\ASTRA_2018_002_AFs_Schweiz\\Output_From_MATSim\\from_nama\\prav_2050A_1pm_AvLowPCUs_test\\output_plans.xml.gz");
new PopulationReader(scenario).readFile(cmd.getOptionStrict("plans-file-path"));
//new PopulationReader(scenario).readFile("C:\\Users\\clivings\\Documents\\ASTRA_2018_002_AFs_Schweiz\\Output_From_MATSim\\from_nama\\prav_2050A_1pm_AvLowPCUs_test\\output_plans.xml.gz");
Population originalPopulation = scenario.getPopulation();
// filter females and add to new filtered population object
Population filteredPopulation = PopulationUtils.createPopulation(config);
......@@ -28,7 +39,8 @@ public class RunFilters {
}
}
// write out new population
new PopulationWriter(filteredPopulation).write("C:\\Users\\clivings\\Documents\\ASTRA_2018_002_AFs_Schweiz\\ProcessingResultsForOthers\\filtered_population.xml");
//new PopulationWriter(filteredPopulation).write("C:\\Users\\clivings\\Documents\\ASTRA_2018_002_AFs_Schweiz\\ProcessingResultsForOthers\\filtered_population.xml");
new PopulationWriter(filteredPopulation).write(cmd.getOptionStrict("output-file-path"));
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment