-
Notifications
You must be signed in to change notification settings - Fork 9
Description
In situations where multiple mined-conditions are available to satisfy a requirement it would be very convenient if there were means to prioritize certain conditions over others. From my observation it is currently random which condition is selected (i.e. depends on the order of elements in a HashMap/-Set).
For example we are using a custom access-cycle configuration that uses two LocalConditions and one RemoteConditions miner, similar like the FocusedAccessCycleConfiguration.Wide configuration does, so this issue probably also applies to all that use that config.
When a user has a operational floating server available plus a valid local personal license, it would be good if the Access-Cyle would always select the personal and acquires the corresponding grant over the floating-license.
This reduces the number of occupied floating seats without the need to disable the floating license locally.
At the moment I can think of two ways to implement this:
- Ensure the miner registries establish a stable order (e.g. via LinkedHashMap to maintain the order of the passed List) to get a stable condition order in the following process.
The priorities are then implicitly defined in the AccessCycleConfiguration through the order of the condition miners passed to the registry. - Assign priorities to MinedConditions according to which the mined valid conditions are sorted before one is finally selected to satisfy a requirement
The priorities are then defined explicitly by assigning an integer priority to each condition.
The first approach seems to be a bit simpler to implement to me but has the disadvantage that it the priorities are not explicitly modeled and that it has to be ensured that the order is also maintained in the entire mining process.
If you are interested I can offer to provide a PR to implement this in the way you prefer.