Skip to content
Snippets Groups Projects
test_esipp_problem.py 38.8 KiB
Newer Older
  • Learn to ignore specific revisions
  •                 ipp.instance.var_v_glljqk[('mynet', node_A, node_EXP, 0, q, 0)]
                    ),
                0.0,
                abs_tol=1e-6
                )
            # interval 1: export only
            assert math.isclose(
                pyo.value(
                    ipp.instance.var_v_glljqk[('mynet', node_IMP, node_A, 0, q, 1)]
                    ),
                0.0,
                abs_tol=1e-6
                )
            assert math.isclose(
                pyo.value(
                    ipp.instance.var_v_glljqk[('mynet', node_A, node_EXP, 0, q, 1)]
                    ),
                1.0,
                abs_tol=1e-6
                )
            
            # IA amplitude
            assert math.isclose(
                pyo.value(
                    ipp.instance.var_v_amp_gllj[('mynet', node_IMP, node_A, 0)]
                    ),
                2.0,
                abs_tol=0.01)
            # AE amplitude
            assert math.isclose(
                pyo.value(
                    ipp.instance.var_v_amp_gllj[('mynet', node_A, node_EXP, 0)]
                    ),
                1.0,
                abs_tol=0.01)
            
            # capex should be 7.0: 4+3
            assert math.isclose(pyo.value(ipp.instance.var_capex), 7.0, abs_tol=1e-3)
            
            # sdncf should be -2.5: -3.5+1.0
            assert math.isclose(
                pyo.value(ipp.instance.var_sdncf_q[q]), -2.5, abs_tol=1e-3
                )
            
            # the objective function should be -9.5: -7.5-2.5
            assert math.isclose(pyo.value(ipp.instance.obj_f), -9.5, abs_tol=1e-3)
        
        # *************************************************************************
        # *************************************************************************
    
        
    # *****************************************************************************
    # *****************************************************************************