artofscience / SAOR

Sequential Approximate Optimization Repository
GNU General Public License v3.0
5 stars 1 forks source link

Added first version of mixed intervening variable #61

Closed aatmdelissen closed 3 years ago

aatmdelissen commented 3 years ago

I've written a simplified version of an arbitrarily mixed scheme for different intervening variables. So no variation in approximation can be used yet, although this object could be used in any approximation scheme.

Construction is as follows, where the default can also be None to not set an intervening variable

mix = Mixed(n_variables, n_responses, default=default_intervening_variable())

After that different intervening variables can be to replaced or to added in a certain combinations of responses & variables. If no variable or response is given, it acts by default on all the variables/responses

mix.set_intervening(ConLin(), var=selected_variables, resp=selected_responses)  # Replace
mix.add_intervening(ConLin(), var=selected_variables, resp=selected_responses)  # Add to existing variables

Reference: Issue #52.