Exemplo n.º 1
0
def getUserProfileModel02():
    idealX = 0.5
    idealY = 0.6
    prefFncX=PrefFncX([Point(0, 0), Point(idealX, 1), Point(1, 0)])
    prefFncY=PrefFncY([Point(0, 0), Point(1, idealY), Point(0, 1)])
    aggrFnc = AggrFnc([2,1])
    return UserProfileModel(prefFncX, prefFncY, aggrFnc);
Exemplo n.º 2
0
 def exportAsPrefFncY(self, linPrefModelConf):
     return PrefFncY([
         Point(0, 0),
         Point(1, self.iCoordinate - self.bottom / 2),
         Point(1, self.iCoordinate + self.bottom / 2),
         Point(0, linPrefModelConf.SIZE_Y_DATA_CUBE)
     ])
Exemplo n.º 3
0
 def exportAsPrefFncY(self, linPrefModelConf):
     # points:List<Point>
     points = [
         Point(0, 0),
         Point(1, self.iCoordinate),
         Point(0, linPrefModelConf.SIZE_Y_DATA_CUBE)
     ]
     # PrefFnc
     return PrefFncY(points)
Exemplo n.º 4
0
def getUserProfileModelExample02():
    idealX = 0.5
    idealY = 0.9
    prefFncX=PrefFncX([Point(0, 0), Point(idealX, 1), Point(2, 0)])
    prefFncY=PrefFncY([Point(0, 0), Point(1, idealY), Point(0, 1.25)])
    prefFncX=prefFncX.exportRefractedPrefFncX();
    prefFncY=prefFncY.exportRefractedPrefFncY();
    aggrFnc = AggrFnc([0.5, 1])
    return UserProfileModel(prefFncX, prefFncY, aggrFnc);
 def exportUserProfileModel(self, dimensionX, dimensionY):
     # prefFncModelX:APrefFncModel
     prefFncModelX = self.prefFncModels[dimensionX]
     prefFncModelY = self.prefFncModels[dimensionY]
     # prefFncX:List<Point>
     prefFncX = prefFncModelX.exportPrefFnc(
         None).lineSegments.exportPoints()
     prefFncY = [
         Point(p.y, p.x) for p in prefFncModelY.exportPrefFnc(
             None).lineSegments.exportPoints()
     ]
     w1 = self.aggrFnc.weights[dimensionX]
     w2 = self.aggrFnc.weights[dimensionY]
     aggrFnc = AggrFnc([0.5, 0.5])
     return UserProfileModel(PrefFncX(prefFncX), PrefFncY(prefFncY),
                             aggrFnc)
Exemplo n.º 6
0
 def exportAsPrefFncY(self, linPrefModelConf):
     # pointsRevers:Point[]
     pointsRevers = [Point(p.y, p.x) for p in self.points]
     # PrefFncX
     return PrefFncY(pointsRevers)
Exemplo n.º 7
0
 def exportPrefFncYNewModel(self, linPrefModelConf):
   return PrefFncY([Point(0, 0), Point(1, self.iy), Point(1, self.iy +0.1), Point(0, linPrefModelConf.SIZE_Y_DATA_CUBE)])
Exemplo n.º 8
0
 def exportPrefFncYTriangularModel(self, linPrefModelConf):
   return PrefFncY([Point(0, 0), Point(1, self.iy), Point(0, linPrefModelConf.SIZE_Y_DATA_CUBE)])
Exemplo n.º 9
0
 def exportPrefFncY(self):
     return PrefFncY([Point(0, 0), Point(1, self.iy), Point(0, 1)])