library(optaas.client) x <- IntParameter("int_x", id="x", minimum=0, maximum=20) y <- IntParameter("int_y", id="y", minimum=0, maximum=20) x_smaller_than_y <- '#x < #y' z <- FloatParameter("float_z", id="z", minimum=0, maximum=1, optional=TRUE) z_larger_than_x <- 'if #z is_present then #z >= #x' z_absent <- 'if ( #x == 0 ) && ( #y == 0 ) then #z is_absent' choice <- ChoiceParameter("choice_xy", choices=list(x, y), id="xy", default=y) if_x_present_then_z_is_small <- 'if #x is_present then #z < 0.1' if_x_chosen_then_z_is_small <- 'if #xy == #x then #z < 0.4' if_z_big_then_x_not_chosen <- 'if #z > 0.9 then #xy != #x' abc <- CategoricalParameter('cat', values=list('a', 'b', 'c'), id='abc') if_b_then_x_is_0 <- 'if #abc == "b" then #x == 0' client <- OPTaaSClient$new("https://optaas.mindfoundry.ai", "Your OPTaaS API Key") task <- client$create_task( title="My Task With Constraints", parameters=list(choice, z, abc), constraints=list( if_x_chosen_then_z_is_small, if_z_big_then_x_not_chosen, if_b_then_x_is_0 ) ) for (i in 1:20) { config_values <- task$generate_configuration()$values print(paste(names(config_values), config_values, sep = "=", collapse = ", ")) }