I have a two layer logic problem, and limited programming skills so I made a problem that I do not know how to solve, outline of what does not work is below.
I need to enable the user (me) to choose which combination of algorithms to use. A combination of algorithms may be applied (not just one at a time, or any), so I cannot use an 'or' operator. I need to be able to use multiple algorithms simultaneously to get a solution, while ignoring algorithms that are not in use.
public bool useAa (get; set;)
public bool useBb (get; set;)
public bool useCc (get; set;)
public bool useDd (get; set;)
public bool? doaa { get; set; }
public bool? dobb { get; set; }
public bool? docc { get; set; }
public bool? dodd { get; set; }
public bool? doee { get; set; }
if ((x >0) & (aa == true))
{
doaa = true;
}
else doaa = false;
if (useAa == false)
{
doaa = null;
}
if ((y >0) & (bb == true))
{
dobb = true;
}
else dobb = false;
if (useBb == false)
{
dobb = null;
}
if ((z >0) & (cc == true))
{
docc = true;
}
else docc = false;
if (useCc == false)
{
docc = null;
}
if ((e >0) & (ee == true))
{
doee = true;
}
else doee = false;
if (useEe == false)
{
doee = null;
}
...
if ((doaa.HasValue && doaa == true) & (dobb.HasValue && dobb == true) & (docc.HasValue && docc == true) & doee.HasValue && doee == true))
{
holy_grail_found (stuff);
}