dustinrue/ControlPlane — Issue #118: Feature: Negative Confidence or "NOT" operator on rules
Author: drfrogsplat
Created: 2012-01-12 02:34:53+00:00
State: open

All of the rules are currently set up to positively contribute to the confidence for a particular context, but I'd find it very useful to be able to subtract from a specific confidence.

I imagine this would be reasonably simple to implement (easier than AND, NOT, OR, XOR logic rules, anyway!) but would allow you to construct some of this kind of logic straight away.

Some of the rules sort of let you do this, e.g. with NetworkLink these are equivalent:
- Context A has a negative confidence for NetworkLink on Ethernet being Active
- All Contexts other than A have a positive confidence for NetworkLink on Ethernet being Inactive (and the overall confidence level required to switch is increased slightly).
But this only really works on rules where they have an in-built "NOT" operation.

Most don't let you do this, they only let you act on positive matches (i.e. Bluetooth, Bonjour, CoreLocation, FireWire, IP, Monitor, RunningApplication, ShellScript, USB, WiFi).

It's quite a bit harder if you have a few similar contexts, which have a number of rules in common (e.g. network range, peripherals, time of day, etc) but are differentiated by some arbitrary rule (existence of peripheral A vs B, or LAN vs Wifi network connection). It becomes very hard to tune all the confidences when you can only add them together.

I can also imagine a case for making sure your computer NEVER switches to a specific context under some condition
(e.g. no matter what, don't switch to my 'P2P File Sharing' context if I'm at work, even though I happened to bring my external hard drive in, or am working later than usual, or some other rule matches unexpectedly).

Even if all this could be done with carefully thought out positive confidence rules, I think having a negative confidence option would allow for simpler rule sets in cases like these.