ProgramType         {algorithm}
ObjectiveFunction   GCOP
ModelExecutable     ./ostrich-runs-raven.sh
PreserveBestModel   ./save_best.sh
#OstrichWarmStart   yes

ModelSubdir processor_

BeginExtraDirs
model
#best
EndExtraDirs

BeginFilePairs
  raven-gr4j-cemaneige.rvp.tpl;    raven-gr4j-cemaneige.rvp
  raven-gr4j-cemaneige.rvc.tpl;    raven-gr4j-cemaneige.rvc
  #can be multiple (.rvh, .rvi)
EndFilePairs

#Parameter/DV Specification
BeginParams
  #parameter    init.    low                 high                 tx_in  tx_ost   tx_out
  par_x1        random   {lowerBounds.GR4J_X1}       {upperBounds.GR4J_X1}        none   none     none
  par_x2        random   {lowerBounds.GR4J_X2}       {upperBounds.GR4J_X2}        none   none     none
  par_x3        random   {lowerBounds.GR4J_X3}       {upperBounds.GR4J_X3}        none   none     none
  par_x4        random   {lowerBounds.GR4J_X4}       {upperBounds.GR4J_X4}        none   none     none
  par_x5        random   {lowerBounds.CEMANEIGE_X1}  {upperBounds.CEMANEIGE_X1}   none   none     none
  par_x6        random   {lowerBounds.CEMANEIGE_X2}  {upperBounds.CEMANEIGE_X2}   none   none     none
EndParams

BeginTiedParams
  # par_half_x1 = par_x1 * 0.5 * 1000  --> half of it but in [mm] not [m]
  # Xtied = (c1 * X) + c0
  # --> c0 = 0.0
  # --> c1 = 500.
  #
  par_half_x1 1 par_x1 linear 500.0 0.0 free
  #
  # par_1_minus_x6 = - par_x6 + 1.0
  # Xtied = (c1 * X1) + c0
  # --> c0 =  1.0
  # --> c1 = -1.0
  #
  par_1_minus_x6 1 par_x6 linear -1.00 1.00 free
EndTiedParams

BeginResponseVars
  #name   filename                              keyword         line    col     token
  NS      ./model/output/{run_name}-{run_index}_Diagnostics.csv;       OST_NULL        1       3       ','
EndResponseVars

BeginTiedRespVars
  NegNS 1 NS wsum -1.00
EndTiedRespVars

BeginGCOP
  CostFunction NegNS
  PenaltyFunction APM
EndGCOP

BeginConstraints
        # not needed when no constraints, but PenaltyFunction statement above is required
        # name     type     penalty    lwr   upr   resp.var
EndConstraints

# Randomsed control added
{random_seed}

#Algorithm should be last in this file:

BeginDDSAlg
        PerturbationValue 0.20
        MaxIterations {max_iterations}
        UseRandomParamValues
        # UseInitialParamValues
        # above intializes DDS to parameter values IN the initial model input files
EndDDSAlg
