示例#1
0
def alternate_definition():
    return ManualTuneDefinition(
        get_y=lambda: 46,
        get_x=lambda: 1293,
        set_x=lambda x: None,
        target='foo',
    )
示例#2
0
def equation_definition():
    """x^2 - 1, x = (1, -1)"""
    equation = dict(x=4)
    equation['y'] = lambda: equation['x']**2
    return ManualTuneDefinition(get_x=lambda: equation['x'],
                                set_x=lambda x: equation.__setitem__('x', x),
                                get_y=lambda: equation['y'](),
                                target=1)
示例#3
0
def attr_definition(attr_dict):
    return ManualTuneDefinition(get_y=lambda: attr_dict['y'],
                                get_x=lambda: attr_dict['x'],
                                set_x=lambda x: attr_dict.__setitem__('x', x),
                                target=attr_dict['target'],
                                domain=attr_dict['domain'])