From fc9a509f6e21251dcda15298a47719afcff21427 Mon Sep 17 00:00:00 2001 From: Jeremy Sadler <53983960+jezsadler@users.noreply.github.com> Date: Thu, 14 Jan 2021 15:47:25 +0000 Subject: [PATCH] Constraints only applied when ENTMOOT uses Gurobi (#86) * Add files via upload First take on ENTMOOT strategy - init and suggest_experiments functions implemented. * Add files via upload Fixed some of the documentation * Update and rename emstrat.py to entmoot.py Renaming * Add files via upload * Adding ENTMOOT test * Turning off verbose logging * Update __init__.py * Update ci.yml * Update entmoot.py Changed default optimizer type to Gurobi, and added an error if constraints are applied when optimizer type is set to sampling. * Update entmoot.py Set default optimizer type back to sampling --- summit/strategies/entmoot.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/summit/strategies/entmoot.py b/summit/strategies/entmoot.py index 480f37e1..15de72d1 100644 --- a/summit/strategies/entmoot.py +++ b/summit/strategies/entmoot.py @@ -218,6 +218,14 @@ def __init__( self.optimizer_type = optimizer_type else: self.optimizer_type = "sampling" # default optimizer: sampling + + if self.optimizer_type == "sampling" & self.constraints is not None: + raise ValueError( + "Constraints can only be applied when ENTMOOT is using \ + global solver. Set optimizer_type = \"global\" or remove \ + constraints." + ) + """ Sets an initial points generator. Can be either - "random" for uniform random numbers,