Esempio n. 1
0
    def test_cuts_valid_for_optimal_tighter_m_fme(self):
        m = models.twoDisj_twoCircles_easy()

        # this M comes from the fact that y \in (0,8) and x \in (0,6)
        TransformationFactory('gdp.cuttingplane').apply_to(
            m, bigM=83, create_cuts=create_cuts_fme)
        self.check_cuts_valid_for_optimal(m)
Esempio n. 2
0
    def test_cuts_valid_for_optimalFacet_tighter_m_inf_norm(self):
        m = models.twoDisj_twoCircles_easy()

        # this M comes from the fact that y \in (0,8) and x \in (0,6)
        TransformationFactory('gdp.cuttingplane').apply_to(
            m, bigM=83, norm=float('inf'))
        self.check_cuts_valid_on_facet_containing_optimal(m)
Esempio n. 3
0
 def test_cuts_valid_on_facet_containing_optimal_inf_norm(self):
     m = models.twoDisj_twoCircles_easy()
     TransformationFactory('gdp.cuttingplane').apply_to(m,
                                                        bigM=1e6,
                                                        norm=float('inf'),
                                                        verbose=True)
     self.check_cuts_valid_on_facet_containing_optimal(m)
Esempio n. 4
0
 def test_cuts_valid_for_other_extreme_points(self):
     # testing that we don't cut off anything on "the other side" (of the R^2
     # picture). There's little reason we should, but this is also a sanity
     # check that the cuts are in the correct direction. (Which one can lose
     # confidence about in the case of numerical difficulties...)
     m = models.twoDisj_twoCircles_easy()
     TransformationFactory('gdp.cuttingplane').apply_to(m, bigM=1e6)
     self.check_cuts_valid_for_other_extreme_points(m)
Esempio n. 5
0
 def test_cuts_valid_on_facet_containing_optimal_fme(self):
     m = models.twoDisj_twoCircles_easy()
     TransformationFactory('gdp.cuttingplane').apply_to(
         m, bigM=1e6, create_cuts=create_cuts_fme, verbose=True)
     self.check_cuts_valid_on_facet_containing_optimal(m)
Esempio n. 6
0
    def test_cuts_valid_for_optimal(self):
        m = models.twoDisj_twoCircles_easy()
        TransformationFactory('gdp.cuttingplane').apply_to(m, bigM=1e6)

        self.check_cuts_valid_for_optimal(m)
Esempio n. 7
0
 def test_cuts_valid_for_other_extreme_points_tighter_m_inf_norm(self):
     m = models.twoDisj_twoCircles_easy()
     TransformationFactory('gdp.cuttingplane').apply_to(
         m, bigM=83, norm=float('inf'), cut_filtering_threshold=0.5)
     self.check_cuts_valid_for_other_extreme_points(m)
Esempio n. 8
0
 def test_cuts_valid_for_other_extreme_points_tighter_m_fme(self):
     m = models.twoDisj_twoCircles_easy()
     TransformationFactory('gdp.cuttingplane').apply_to(
         m, bigM=83, create_cuts=create_cuts_fme)
     self.check_cuts_valid_for_other_extreme_points(m)