Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config: setInsistingOnDeprecatedConfigVersion to "false" #3484

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.matsim.contrib.matrixbasedptrouter.utils.CreateTestPopulation;
import org.matsim.core.config.Config;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.config.groups.ScoringConfigGroup;
import org.matsim.core.controler.Controler;
import org.matsim.core.controler.OutputDirectoryHierarchy;
import org.matsim.core.network.io.NetworkWriter;
Expand Down Expand Up @@ -106,11 +107,8 @@ void testIntegration() throws IOException {
config.plans().setInputFile(path+"plans.xml");

//add home and work activity to plansCalcScoreConfigGroup
config.scoring().addParam("activityType_0", "home");
config.scoring().addParam("activityTypicalDuration_0", "43200");
config.scoring().addParam("activityType_1", "work");
config.scoring().addParam("activityTypicalDuration_1", "28800");

config.scoring().addActivityParams(new ScoringConfigGroup.ActivityParams("home").setTypicalDuration(43200));
config.scoring().addActivityParams(new ScoringConfigGroup.ActivityParams("work").setTypicalDuration(28800));

Scenario scenario = ScenarioUtils.loadScenario(config);
BoundingBox nbb = BoundingBox.createBoundingBox(network);
Expand Down
7 changes: 7 additions & 0 deletions matsim/src/main/java/org/matsim/core/config/ConfigReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ protected void setDoctype(final String doctype) {
}
else if ( CONFIG_V2.equals( doctype ) ) {
this.delegate = new ConfigReaderMatsimV2( this.config );
// config.global().setInsistingOnDeprecatedConfigVersion(false);
// // Currently, V2 is the current version.
// // IMO: The default should be "false". -> Change in {@link GlobalConfigGroup}.
// This cannot be activated here, because mny tests, e.g. in DRT fails, because ScoringConfigGroup detects a deprecated syntax and then
// aborts, because of the following check -- so this must be cleaned up first. :
// usesDeprecatedSyntax && !config.global().isInsistingOnDeprecatedConfigVersion())
// kmt, Aug'24
log.info( "using config_v2-reader" );
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public static Config createConfig(URL context) {
public static Config createConfig() {
Config config = new Config();
config.addCoreModules();
config.global().setInsistingOnDeprecatedConfigVersion(false); // IMO: The default should be "false". -> Change in {@link GlobalConfigGroup}. kmt, Aug'24
return config;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ public void setCoordinateSystem(final String coordinateSystem) {
// ---
private boolean insistingOnDeprecatedConfigVersion = true ;
// yyyy this should be set to false eventually. kai, aug'18
// IMO: Yes, false would be the default and if read in an older version, set it to true.
// That would also avoid the setting to "false" in ConfigUtils. This should not be needed, because creating
// a new Config should always result in the newest version. // kmt, Aug'24
private static final String INSITING_ON_DEPRECATED_CONFIG_VERSION = "insistingOnDeprecatedConfigVersion" ;
@StringGetter( INSITING_ON_DEPRECATED_CONFIG_VERSION )
public final boolean isInsistingOnDeprecatedConfigVersion() { return this.insistingOnDeprecatedConfigVersion ; }
Expand Down
Loading