def new_getvalue( state, name, p): """ Called every time a node value is used in an expression. It will override the value for the current step only. """ value = util.default_get_value( state, name, p ) if name == 'B': # pick at random from True, False and original value return random.choice( [True, False, value] ) else: return value
def new_getvalue( state, name, p): """ Called every time a node value is used in an expression. It will override the value for the current step only. Returns random values for the node states """ global TARGETS value = util.default_get_value( state, name, p ) if name in TARGETS: # pick at random from True, False and original value return choice( [True, False, value] ) else: return value
def new_getvalue(state, name, p): """ Called every time a node value is used in an expression. It will override the value for the current step only. Returns random values for the node states """ global TARGETS value = util.default_get_value(state, name, p) if name in TARGETS: # pick at random from True, False and original value return choice([True, False, value]) else: return value