def promisingness_of(self, fm: FARGModel, elem: Elem) -> float: # TODO Scouts, probably constructed from the slipnet, should search # for what's promising and apply tags. It shouldn't be hard-coded # in the Want class. if isinstance(elem, Consume): result = 0.0 if fm.is_blocked(elem): result += 0.1 else: result += 0.2 if fm.can_act(elem): result += 0.2 return result elif isinstance(elem, CellRef): #return 2.0 if elem.contents == self.target else 0.0 return 20.0 if has_avail_value(elem.contents, self.target) else 0.0 elif isinstance(elem, GettingCloser): # TODO Promising, not GettingCloser #print('WANTGC', elem) #DIAG return 10 * elem.weight else: return 0.0
def can_go(self, fm: FARGModel): return not fm.is_blocked(self)