Exemplo n.º 1
0
    def test_lookup(self):
        from pysd.py_backend.functions import lookup

        xpts = [0, 1, 2, 3, 5, 6, 7, 8]
        ypts = [0, 0, 1, 1, -1, -1, 0, 0]

        for x, y in zip(xpts, ypts):
            self.assertEqual(y, lookup(x, xpts, ypts),
                             "Wrong result at X=" + str(x))
def kits_availability_for_testing_table(x):
    """
    Real Name: b'kits availability for testing table'
    Original Eqn: b'( [(0,0)-(1,1)],(0,0),(0.25,0.6),(0.5,0.85),(1,1))'
    Units: b'dmnl'
    Limits: (None, None)
    Type: lookup

    b''
    """
    return functions.lookup(x, [0, 0.25, 0.5, 1], [0, 0.6, 0.85, 1])
Exemplo n.º 3
0
def effect_of_system_pressure_on_productivity():
    """
    Real Name: b'Effect of System Pressure on Productivity'
    Original Eqn: b'WITH LOOKUP ( System Pressure, ([(0,0)-(2,2)],(0,0.62),(0.2,0.65),(0.4,0.7),(0.6,0.79),(0.8,0.89),(1,1),(1.2,1.14)\\\\ ,(1.4,1.24),(1.6,1.32),(1.8,1.37),(2,1.4) ))'
    Units: b'Dmnl'
    Limits: (None, None)
    Type: component

    b''
    """
    return functions.lookup(system_pressure(), [0, 0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2],
                            [0.62, 0.65, 0.7, 0.79, 0.89, 1, 1.14, 1.24, 1.32, 1.37, 1.4])
def impact_of_motivation_on_effort(x):
    """
    Real Name: Impact of Motivation on Effort
    Original Eqn: ( [(0,0)-(10,1)],(0,0),(0.285132,0.0616114),(0.448065,0.232228),(0.570265,0.492891),(0.733198\ ,0.772512),(0.95723,0.862559),(1.4664,0.914692),(3.19756,0.952607),(4.03259,0.957346\ ))
    Units: Dmnl
    Limits: (None, None)
    Type: lookup


    """
    return functions.lookup(
        x, [0, 0.285132, 0.448065, 0.570265, 0.733198, 0.95723, 1.4664, 3.19756, 4.03259],
        [0, 0.0616114, 0.232228, 0.492891, 0.772512, 0.862559, 0.914692, 0.952607, 0.957346])
Exemplo n.º 5
0
def effect_of_system_pressure_on_productivity():
    """
    Real Name: b'Effect of System Pressure on Productivity'
    Original Eqn: b'WITH LOOKUP ( System Pressure, ([(0,0)-(2,2)],(0,0.62),(0.2,0.65),(0.4,0.7),(0.6,0.79),(0.8,0.89),(1,1),(1.2,1.14)\\\\ ,(1.4,1.24),(1.6,1.32),(1.8,1.37),(2,1.4) ))'
    Units: b'Dmnl'
    Limits: (None, None)
    Type: component

    b''
    """
    return functions.lookup(
        system_pressure(), [0, 0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2],
        [0.62, 0.65, 0.7, 0.79, 0.89, 1, 1.14, 1.24, 1.32, 1.37, 1.4])
Exemplo n.º 6
0
def effect_of_system_pressure_on_work_year():
    """
    Real Name: b'Effect of System Pressure on Work Year'
    Original Eqn: b'WITH LOOKUP ( System Pressure, ([(0,0)-(2.5,1.5)],(0,0.75),(0.25,0.79),(0.5,0.84),(0.75,0.9),(1,1),(1.25,1.09),(1.5\\\\ ,1.17),(1.75,1.23),(2,1.25),(2.25,1.25),(2.5,1.25) ))'
    Units: b'Dmnl'
    Limits: (None, None)
    Type: component

    b''
    """
    return functions.lookup(system_pressure(),
                            [0, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5],
                            [0.75, 0.79, 0.84, 0.9, 1, 1.09, 1.17, 1.23, 1.25, 1.25, 1.25])
def impact_of_motivation_on_effort(x):
    """
    Impact of Motivation on Effort

    Dmnl

    lookup


    """
    return functions.lookup(
        x, [0, 0.285132, 0.448065, 0.570265, 0.733198, 0.95723, 1.4664, 3.19756, 4.03259],
        [0, 0.0616114, 0.232228, 0.492891, 0.772512, 0.862559, 0.914692, 0.952607, 0.957346])
def effect_on_renovation_and_construction():
    """
    effect on renovation and construction

    Dmnl

    component


    """
    return functions.lookup(
        perceived_current_safety(),
        [0, 0.25, 0.5, 0.75, 0.85, 1, 1.25, 1.5, 2, 4, 5],
        [5, 3.5, 2, 1.2, 0.9, 0.7, 0.35, 0.2, 0.1, 0.1, 0.1])
Exemplo n.º 9
0
def effect_of_system_pressure_on_work_year():
    """
    Real Name: b'Effect of System Pressure on Work Year'
    Original Eqn: b'WITH LOOKUP ( System Pressure, ([(0,0)-(2.5,1.5)],(0,0.75),(0.25,0.79),(0.5,0.84),(0.75,0.9),(1,1),(1.25,1.09),(1.5\\\\ ,1.17),(1.75,1.23),(2,1.25),(2.25,1.25),(2.5,1.25) ))'
    Units: b'Dmnl'
    Limits: (None, None)
    Type: component

    b''
    """
    return functions.lookup(
        system_pressure(),
        [0, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5],
        [0.75, 0.79, 0.84, 0.9, 1, 1.09, 1.17, 1.23, 1.25, 1.25, 1.25])
def impact_of_motivation_on_effort(x):
    """
    Impact of Motivation on Effort

    Dmnl

    lookup


    """
    return functions.lookup(x, [
        0, 0.285132, 0.448065, 0.570265, 0.733198, 0.95723, 1.4664, 3.19756,
        4.03259
    ], [
        0, 0.0616114, 0.232228, 0.492891, 0.772512, 0.862559, 0.914692,
        0.952607, 0.957346
    ])
Exemplo n.º 11
0
def pesca():
    """
    Real Name: Pesca
    Original Eqn: WITH LOOKUP ( Agua en lago*3, ([(0,0)-(20,1)],(0,0),(4.77064,0.0921053),(8.99083,0.214912),(10.8257,0.359649),(11.9266\ ,0.54386),(12.2936,0.692982),(13.8226,0.815789),(16.4526,0.942982),(20,1) ))
    Units: Dmnl
    Limits: (None, None)
    Type: component

    Porcentaje de necesidades que se pueden cumplir por la pesca.
    """
    return functions.lookup(
        agua_en_lago() * 3,
        [0, 4.77064, 8.99083, 10.8257, 11.9266, 12.2936, 13.8226, 16.4526, 20],
        [
            0, 0.0921053, 0.214912, 0.359649, 0.54386, 0.692982, 0.815789,
            0.942982, 1
        ])