Skip to content

Commit

Permalink
ability to disable coordinated modeling
Browse files Browse the repository at this point in the history
  • Loading branch information
timhilgert committed Apr 12, 2018
1 parent f2e5cd1 commit 1ed729b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
18 changes: 15 additions & 3 deletions src/main/java/edu/kit/ifv/mobitopp/actitopp/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,24 @@ public class Configuration {
*
* erlaubte Konfigurationen:
*
* mopv10 = Nutzung der Parameterschätzungen des MOP 2004-2013 (actiTopp Version 1.0)
* mopv11 = Nutzung der Parameterschätzungen des MOP 2004-2013 (actiTopp Version 1.1)
* mopv10 = Nutzung der Parameterschätzungen des MOP 2004-2013 (nur für actiTopp Version 1.0)
* mopv11 = Nutzung der Parameterschätzungen des MOP 2004-2013 (ab actiTopp Version 1.1)
* stuttgart = Nutzung der Parameterschätzungen auf Basis des MOP 2004-2013 kalibriert auf die Stuttgart-Erhebung
*/

public static final String parameterset = "mopv10";
public static final String parameterset = "mopv11";



/*
* Zu Vergleichszwecken und zur Demonstration der notwendigen Koordinierung bei der Modellierung einer Woche
* Zeigen der Qualität von actiTopp kann die Modellierung auch unkoordiniert durchgeführt werden.
* Das bedeutet, dass Schritt 8A nicht angewendet wird (standarddauer ist immer 0) und damit in Schritt 8B immer das volle Alternativenset zur Verfügung steht.
*
*/
public static boolean coordinated_modelling = true;



//Angabe der Stufen, die Flowlisten für Logit-Modellierungen verwenden
public static final String[] flowlist_initials =
Expand Down
20 changes: 14 additions & 6 deletions src/main/java/edu/kit/ifv/mobitopp/actitopp/Coordinator.java
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,10 @@ private void executeStep8A(String id)

// Eigenschaft abspeichern
currentActivity.addAttributetoMap("standarddauer",(step.getAlternativeChosen().equals("yes") ? 1.0d : 0.0d));

// Bei unkoordinierter Modellierung ohne Stabilitätsaspekte wird der Wert immer mit 0 überschrieben!
if (!Configuration.coordinated_modelling) currentActivity.addAttributetoMap("standarddauer", 0.0d);

}
}
}
Expand All @@ -497,8 +501,8 @@ private void executeStep8_MainAct_DC(String id)
for (HTour currentTour : currentDay.getTours())
{
boolean running=false;
if (id.equals("8B") && currentTour.getIndex()==0) running=true;
if (id.equals("8D") && currentTour.getIndex()!=0) running=true;
if (id.equals("8B") && currentTour.getIndex()==0) running=true; // 8B gilt nur für Haupttouren (TourIndex=0)
if (id.equals("8D") && currentTour.getIndex()!=0) running=true; // 8D gilt nur für NICHT-Haupttouren (TourIndex!=0)

if (running)
{
Expand Down Expand Up @@ -548,7 +552,8 @@ private void executeStep8_MainAct_MC(String id)
double chosenTimeCategory = currentActivity.getAttributesMap().get("actdurcat_index");
DefaultMCModelStep step = new DefaultMCModelStep(id + (int) chosenTimeCategory, this);
step.setModifiedDTDtoUse(currentActivity.getType(), (int) chosenTimeCategory);
step.setModifyDTDAfterStep(true);
// angepasste Zeitverteilungen aus vorherigen Entscheidungen werden nur im koordinierten Fall verwendet
step.setModifyDTDAfterStep(Configuration.coordinated_modelling);
step.setDTDTypeToUse(INDICATOR_ACT_DURATIONS);
step.doStep();

Expand Down Expand Up @@ -619,7 +624,8 @@ private void executeStep8_NonMainAct_MC(String id)
double chosenTimeCategory = currentActivity.getAttributesMap().get("actdurcat_index");
DefaultMCModelStep step = new DefaultMCModelStep(id + (int) chosenTimeCategory, this);
step.setModifiedDTDtoUse(currentActivity.getType(), (int) chosenTimeCategory);
step.setModifyDTDAfterStep(true);
// angepasste Zeitverteilungen aus vorherigen Entscheidungen werden nur im koordinierten Fall verwendet
step.setModifyDTDAfterStep(Configuration.coordinated_modelling);
step.setDTDTypeToUse(INDICATOR_ACT_DURATIONS);
step.doStep();

Expand Down Expand Up @@ -1096,7 +1102,8 @@ private void executeStep10MC(String id, int tournrdestages) throws InvalidPatter
DefaultMCModelStep step = new DefaultMCModelStep(stepID, this);
char mainActivityTypeInTour = currentTour.getActivity(0).getType();
step.setModifiedDTDtoUse(mainActivityTypeInTour, (int) chosenStartCategory);
step.setModifyDTDAfterStep(true);
// angepasste Zeitverteilungen aus vorherigen Entscheidungen werden nur im koordinierten Fall verwendet
step.setModifyDTDAfterStep(Configuration.coordinated_modelling);
//step.setOutPropertyName("tourStartTime");
step.setDTDTypeToUse(INDICATOR_TOUR_STARTTIMES);
int[] bounds = calculateStartingBoundsForTours(currentDay, currentTour, false);
Expand Down Expand Up @@ -1164,7 +1171,8 @@ private void executeStep10ST() throws InvalidPatternException
DefaultMCModelStep mcstep = new DefaultMCModelStep(stepID, this);
char mainActivityTypeInTour = currentTour.getActivity(0).getType();
mcstep.setModifiedDTDtoUse(mainActivityTypeInTour, (int) chosenHomeTimeCategory);
mcstep.setModifyDTDAfterStep(true);
// angepasste Zeitverteilungen aus vorherigen Entscheidungen werden nur im koordinierten Fall verwendet
mcstep.setModifyDTDAfterStep(Configuration.coordinated_modelling);
//step.setOutPropertyName("tourStartTime");
mcstep.setDTDTypeToUse(INDICATOR_ACT_DURATIONS);
int[] mcbounds = calculateBoundsForHomeTime(currentDay, currentTour, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public static void main(String[] args)

// createAndModelOnePerson_Example1();

// createAndModelOnePerson_Example2();
createAndModelOnePerson_Example2();

createAndModelMultiplePersons_Example();
// createAndModelMultiplePersons_Example();

}

Expand Down

0 comments on commit 1ed729b

Please sign in to comment.