@Override
  public GroupPlanStrategy get() {
    final GroupPlanStrategy strategy = instantiateStrategy(sc.getConfig());

    final GroupReplanningConfigGroup configGroup =
        (GroupReplanningConfigGroup)
            sc.getConfig().getModule(GroupReplanningConfigGroup.GROUP_NAME);
    strategy.addStrategyModule(
        new MutateActivityLocationsToLocationsOfOthersModule(
            sc.getConfig().global().getNumberOfThreads(),
            sc.getPopulation(),
            configGroup.getLocationChoiceActivityType()));

    strategy.addStrategyModule(
        GroupPlanStrategyFactoryUtils.createJointTripAwareTourModeUnifierModule(
            sc.getConfig(), tripRouterFactory));

    strategy.addStrategyModule(
        GroupPlanStrategyFactoryUtils.createReRouteModule(
            sc.getConfig(), planRoutingAlgorithmFactory, tripRouterFactory));

    strategy.addStrategyModule(
        GroupPlanStrategyFactoryUtils.createRecomposeJointPlansModule(
            sc.getConfig(),
            ((JointPlans) sc.getScenarioElement(JointPlans.ELEMENT_NAME)).getFactory(),
            planLinkIdentifier));

    return strategy;
  }
  private void testReinput(final boolean isReflective) {
    final SocialNetwork output = generateRandomSocialNetwork(isReflective);
    final String path = utils.getOutputDirectory() + "/sn.xml";

    new SocialNetworkWriter(output).write(path);

    final Scenario sc = ScenarioUtils.createScenario(ConfigUtils.createConfig());
    new SocialNetworkReader(sc).readFile(path);

    final SocialNetwork input = (SocialNetwork) sc.getScenarioElement(SocialNetwork.ELEMENT_NAME);

    Assert.assertEquals("unexpected reflectiveness", output.isReflective(), input.isReflective());

    Assert.assertEquals(
        "unexpected number of egos", output.getEgos().size(), input.getEgos().size());

    Assert.assertEquals("different ego ids", output.getEgos(), input.getEgos());

    final Counter c = new Counter("Test alters of ego # ");
    for (Id ego : output.getEgos()) {
      c.incCounter();
      final Set<Id<Person>> expectedAlters = output.getAlters(ego);
      final Set<Id<Person>> actualAlters = input.getAlters(ego);

      Assert.assertEquals(
          "unexpected number of alters for ego " + ego, expectedAlters.size(), actualAlters.size());

      Assert.assertEquals("unexpected alters for ego " + ego, expectedAlters, actualAlters);
    }

    Assert.assertEquals("different metadata", output.getMetadata(), input.getMetadata());

    c.printCounter();
  }
  private void createScenario() {
    this.initIds();
    Config config = ConfigUtils.createConfig();
    config.qsim().setUseLanes(true);
    ConfigUtils.addOrGetModule(
            config, SignalSystemsConfigGroup.GROUPNAME, SignalSystemsConfigGroup.class)
        .setUseSignalSystems(true);
    Scenario scenario = ScenarioUtils.loadScenario(config);

    // network
    Network net = this.createNetwork(scenario);
    this.writeMatsimNetwork(net, networkOutfile);
    log.info("network written to " + networkOutfile);
    // lanes
    createLanes((MutableScenario) scenario);
    LaneDefinitionsWriter20 laneWriter = new LaneDefinitionsWriter20(scenario.getLanes());
    laneWriter.write(lanesOutfile);
    log.info("lanes written to " + lanesOutfile);
    // signals
    SignalsData signalsData = (SignalsData) scenario.getScenarioElement(SignalsData.ELEMENT_NAME);
    createSignalSystemsAndGroups(signalsData);
    createSignalControl(signalsData);

    SignalsScenarioWriter signalsWriter = new SignalsScenarioWriter();
    signalsWriter.setSignalSystemsOutputFilename(signalSystemsOutfile);
    signalsWriter.setSignalGroupsOutputFilename(signalGroupsOutfile);
    signalsWriter.setSignalControlOutputFilename(signalControlOutfileBC);
    signalsWriter.writeSignalsData(signalsData);
  }
  public static void main(final String[] args) {
    final String socialNetworkFile = args[0];

    final Scenario sc = ScenarioUtils.createScenario(ConfigUtils.createConfig());
    new SocialNetworkReader(sc).parse(socialNetworkFile);

    final SocialNetwork socialNetwork =
        (SocialNetwork) sc.getScenarioElement(SocialNetwork.ELEMENT_NAME);
    log.info("clustering: " + SnaUtils.calcClusteringCoefficient(socialNetwork));
  }
 @Override
 public Object getScenarioElement(String name) {
   return delegate.getScenarioElement(name);
 }