mahf-opt / mahf

A framework for modular construction and evaluation of metaheuristics.
GNU General Public License v3.0
10 stars 0 forks source link

Update `State` to allow multiple mutable references to distinct components without `MutState` #160

Closed Saethox closed 1 year ago

Saethox commented 1 year ago

The API we currently have is kind of weird, with State, MutState and MultiStateTuple, so we might want to integrate this a little bit more. I'm thinking of a State that allows borrowing multiple CustomState wrapped in some sort of Ref and RefMut at the same time, or a single CustomState as &mut, or a tuple of distinct CustomStates as (&mut, &mut, ...).

I have no idea if this really is better, but the current state should not be permanent.