Swift:
class AXLearnability {
var algSent:Bool = false
// problems that may result because of the last deployed algorithm:
var defcons:UniqueItemsPriorityQue = UniqueItemsPriorityQue() // default size = 5
var goal:UniqueItemsPriorityQue = UniqueItemsPriorityQue()
// major problems that force an alg to mutate
var defcon5:UniqueItemsPriorityQue = UniqueItemsPriorityQue()
let trg:TrgCountDown = TrgCountDown() // set lim
func pendAlg() {
// an algorithm has been deployed
// call this method when an algorithm is deployed (in a DiSkillV2 object)
algSent = true
trg.countDown()
}
func pendAlgWithoutConfirmation() {
// an algorithm has been deployed
// call this method when an algorithm is deployed (in a DiSkillV2 object)
algSent = true
//no need to await for a thank you or check for goal manifestation :
// trgTolerance.trigger();
// using this method instead of the default "pendAlg" is the same as
// giving importance to the stick and not the carrot when learning
// this method is mosly fitting work place situations
}
func mutateAlg(input:String) -> Bool {
// you can use an input filter to define defcons
// recommendation to mutate the algorithm ? true/ false
if !algSent {return false} // no alg sent=> no reason to mutate
if goal.contains(str: input){trg.reset();algSent = false;return false}
// goal manifested the sent algorithm is good => no need to mutate the alg
if defcon5.contains(str: input) {trg.reset();algSent = false; return true}
// something bad happend probably because of the sent alg
// recommend alg mutation
if defcons.contains(str: input){algSent = false;return trg.countDown()}
// negative result, mutate the alg if this occures too much
return false
}
}