From bdcd64b69d23b5566b3354ad7edd9935c515137e Mon Sep 17 00:00:00 2001 From: Niels Wouda Date: Wed, 14 Jun 2023 13:07:52 +0200 Subject: [PATCH] Add get_context() to quickstart template --- docs/source/setup/template.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/source/setup/template.rst b/docs/source/setup/template.rst index 28f6563..0e03a16 100644 --- a/docs/source/setup/template.rst +++ b/docs/source/setup/template.rst @@ -5,7 +5,7 @@ The ``alns`` library provides the :class:`~alns.ALNS` algorithm and various acceptance criteria in :mod:`alns.accept`, operator selection schemes in :mod:`alns.select`, and stopping criteria in :mod:`alns.stop`. -You should provide the following: +You should minimally provide the following: * A solution state for your problem that implements an ``objective()`` function. * An initial solution. @@ -48,6 +48,12 @@ The following is a quickstart template that can help you get started: # TODO implement the objective function pass + def get_context(self): + # TODO implement a method returning a context vector. This is only + # needed for some context-aware bandit selectors from MABWiser; + # if you do not use those, this default is already sufficient! + return None + def initial_state() -> ProblemState: # TODO implement a function that returns an initial solution