# get and save defaults
defaultControl <- nsgaControl()
print(defaultControl)
# get current defaults only for real-valued search
nsgaControl("real-valued")
# set defaults for selection operator of real-valued search
nsgaControl("real-valued" = list(selection = "nsgareal_lrSelection"))
nsgaControl("real-valued")
# set defaults for selection and crossover operators of real-valued search
nsgaControl("real-valued" = list(selection = "nsgareal_lrSelection",
crossover = "nsgareal_spCrossover"))
nsgaControl("real-valued")
# restore defaults
nsgaControl(defaultControl)
nsgaControl()
Run the code above in your browser using DataLab