def test_curveCache(self):
     'Ensure that curve caching works properly'
     # Prepare simple curve settings
     curvePack1 = 'ZeroLinear', ((0, 1), (1, 1))
     curvePack2 = 'ZeroLogistic', ((0, 1), (1, 1))
     # Fit curves
     c1 = curve.fit(*curvePack1)
     c2 = curve.fit(*curvePack2)
     c3 = curve.fit(*curvePack1)
     # Make sure that we are getting the same exact curve
     self.assertNotEqual(id(c1), id(c2))
     self.assertEqual(id(c1), id(c3))
Exemple #2
0
 def compute(self):
     curveType = self.get(SocialInfrastructureDemandCurveType)
     curvePoints = self.get(SocialInfrastructureDemandCurvePoints)
     return curve.fit(curveType, curvePoints)
Exemple #3
0
 def compute(self):
     curveType = self.get(ProductiveDemandCurveType)
     curvePoints = self.get(ProductiveDemandCurvePoints)
     return curve.fit(curveType, curvePoints)
Exemple #4
0
 def compute(self):
     curveType = self.get(HouseholdDemandCurveType)
     curvePoints = self.get(HouseholdDemandCurvePoints)
     return curve.fit(curveType, curvePoints)
Exemple #5
0
 def compute(self):
     curveType = self.get(PublicLightingFacilityCountCurveType)
     curvePoints = self.get(PublicLightingFacilityCountCurvePoints)
     return curve.fit(curveType, curvePoints)
Exemple #6
0
 def compute(self):
     curveType = self.get(CommercialFacilityCountCurveType)
     curvePoints = self.get(CommercialFacilityCountCurvePoints)
     return curve.fit(curveType, curvePoints)
Exemple #7
0
 def compute(self):
     curveType = self.get(EducationFacilityCountCurveType)
     curvePoints = self.get(EducationFacilityCountCurvePoints)
     return curve.fit(curveType, curvePoints)
 def compute(self):
     curveType = self.get(SocialInfrastructureDemandCurveType)
     curvePoints = self.get(SocialInfrastructureDemandCurvePoints)
     return curve.fit(curveType, curvePoints)
 def compute(self):
     curveType = self.get(ProductiveDemandCurveType)
     curvePoints = self.get(ProductiveDemandCurvePoints)
     return curve.fit(curveType, curvePoints)
Exemple #10
0
 def compute(self):
     curveType = self.get(HouseholdDemandCurveType)
     curvePoints = self.get(HouseholdDemandCurvePoints)
     return curve.fit(curveType, curvePoints)
Exemple #11
0
 def compute(self):
     curveType = self.get(PublicLightingFacilityCountCurveType)
     curvePoints = self.get(PublicLightingFacilityCountCurvePoints)
     return curve.fit(curveType, curvePoints)
Exemple #12
0
 def compute(self):
     curveType = self.get(CommercialFacilityCountCurveType)
     curvePoints = self.get(CommercialFacilityCountCurvePoints)
     return curve.fit(curveType, curvePoints)
Exemple #13
0
 def compute(self):
     curveType = self.get(EducationFacilityCountCurveType)
     curvePoints = self.get(EducationFacilityCountCurvePoints)
     return curve.fit(curveType, curvePoints)