def getModel(self, userID:int, argsDict:dict): status:float = argsDict[ASequentialSimulation.ARG_STATUS] print("status: " + str(status)) mGlobal:DataFrame = self.getModelGlobal() if self.modeSkip: print("aaaaaaaaaaaaaaaaa") numberOfClick:int = self.getModelPersonAllUsers().getNumberOfClick(userID) print("numberOfClick: " + str(numberOfClick)) if numberOfClick < self.skipClickThreshold: return mGlobal mGlobal.linearNormalizing() #print("GLOBAL:") #print(mGlobal.head(10)) mGlobal = PModelDHondt.multiplyModel(mGlobal, 1.0 - status) mPerson:DataFrame = self.getModelPerson(userID) mPerson.linearNormalizing() mPerson = PModelDHondt.multiplyModel(mPerson, status) rPModel:DataFrame = PModelDHondt.sumModels(mGlobal, mPerson) rPModel.linearNormalizing() #print("VYSLEDNY:") #print(rPModel.head(10)) return rPModel
def test03(): print("Test 03") # methods parametes portfolioModelData1: List[tuple] = [['metoda1', 100], ['metoda2', 80], ['metoda3', 60]] portfolioModel1: DataFrame = pd.DataFrame(portfolioModelData1, columns=["methodID", "votes"]) portfolioModel1.set_index("methodID", inplace=True) portfolioModel1.__class__ = PModelDHondt #portfolioModel1.linearNormalizing() rModel = PModelDHondt.multiplyModel(portfolioModel1, 0.2) print(rModel)