to formalize which logic modules' output is needed to take a decision in a given logic module, we could add a method
public abstract List<Class<? extends SimpleLogicModule>> requires()
to class LogicModule (which is the class defining the satisfied() method)
A typical body of an overriding method could look like this:
List<Class<? extends SimpleLogicModule>> result = new ArrayList<Class<? extends SimpleLogicModule>>();
result.add(Deadtime.class);
return result;
Alternatively, since we have only singleton logic modules, we could return a list of LogicModuleRegistry instances or even LogicModule objects themselves.
to then actually prevent modules from accessing results from modules which they have not declared in their requires() method, we can remove the results argument from the satisfy() method and implement a getResult(logicModule) method instead which then can check if the corresponding logic module actually has been declared as a dependency (not sure we really need to check this for every snapshot, maybe we don't have to implement this for the moment or enable the check only for test cases).
public abstract List<Class<? extends SimpleLogicModule>> requires()
to classLogicModule
(which is the class defining thesatisfied()
method)A typical body of an overriding method could look like this:
Alternatively, since we have only singleton logic modules, we could return a list of
LogicModuleRegistry
instances or evenLogicModule
objects themselves.requires()
method, we can remove theresults
argument from thesatisfy()
method and implement agetResult(logicModule)
method instead which then can check if the corresponding logic module actually has been declared as a dependency (not sure we really need to check this for every snapshot, maybe we don't have to implement this for the moment or enable the check only for test cases).