I need to perform a complex optimization which includes verifying at each small step that all rules have been complied with. Any ideas about how to code these rules?
The rules will not include string matches, instead involving tings like the maximum deliervy run size a given driver is allowed to be given. Or, the type of vehicle needed for pickups from a given store location.
So the rules will tend to be simple math tests, sometimes including the creation of score which reflects how compliant a delivery run is with all rules.
Any suggestion how to handle this?
I guess each rule could be an object, and the RulesList can be dynamically loaded to include certain rules, based on the values is a database, for example.
Any ideas come to mind how to deal with this? I could create an IRule interface to enforce the creation of required functions in all objects which implement that interface.