protected void computeReferenceBiomassValue(SteadyStateSimulationResult simResult) {
    IntegratedSimulationResult intResult = (IntegratedSimulationResult) simResult;
    ISteadyStateModel model = simResult.getModel();

    String IntsimulationMethod = "";
    String metabolimethodtype = "";
    String regulatorysimmethodtype = "";

    if (intResult.getMethod().equals(IntegratedSimulationMethods.SRFBA))
      IntsimulationMethod = IntegratedSimulationMethods.SRFBA;
    else {
      IntsimulationMethod = IntegratedSimulationMethods.INTEGRATED_BRN;
      metabolimethodtype = intResult.getMetSimulMethod();
      regulatorysimmethodtype = RegulatoryNetworkSimulationMethods.BRNV;
    }

    EnvironmentalConditions env = simResult.getEnvironmentalConditions();
    VariablesContainer varcont = intResult.getInitialUsedVariablesContainer();

    HashSet<String> falsenodes = null;
    falsenodes = intResult.getInitialusedfalsenodes();

    IntegratedSimulationControlCenter simulationControlCenter =
        new IntegratedSimulationControlCenter(
            env,
            null,
            model,
            IntsimulationMethod,
            metabolimethodtype,
            regulatorysimmethodtype,
            varcont,
            falsenodes,
            true,
            solver);

    // SteadyStateSimulationResult solution = null;
    IntegratedSimulationResult solution = null;

    try {
      solution = (IntegratedSimulationResult) simulationControlCenter.simulate();
    } catch (Exception e) {
      System.err.println(
          "YieldMinimumBiomassObjectiveFunction: could not compute reference biomass value");
      e.printStackTrace();
    }

    if (solution != null) {
      double biomass = solution.getFluxValues().getValue(biomassId);

      minimumBiomassValue = biomass * minimumBiomassPercentage;
    }

    biomassComputed = true;
  }
  public double evaluate(SteadyStateSimulationResult simResult) {

    if (!biomassComputed) computeReferenceBiomassValue(simResult);
    FluxValueMap fluxValues = simResult.getFluxValues();

    double biomassValue = fluxValues.getValue(biomassId);

    double desiredFlux = fluxValues.getValue(desiredFluxId);

    double fitness = 0.0;

    if (biomassValue >= (minimumBiomassPercentage * minimumBiomassValue)) {

      fitness = desiredFlux;
    }

    return fitness;
  }