Beispiel #1
0
    def _run_map(self):

        args = self.args
        # if doing anything online, revalidate cache
        Cacher.revalidate(args.map_id, self.users_info)

        if (args.map_id and args.user_id):  # passed both -m and -u but not -l
            replays2 = [
                OnlineReplay.from_map(args.map_id, user_id, args.cache,
                                      replay_id)
                for user_id, replay_id in self.users_info.items()
            ]
            comparer = Comparer(args.threshold,
                                self.replays_check,
                                replays2=replays2)
            comparer.compare(mode="double")
            return

        if (args.map_id):  # only passed -m
            # get all 50 top replays
            replays = [
                OnlineReplay.from_map(args.map_id, user_id, args.cache,
                                      replay_id)
                for user_id, replay_id in self.users_info.items()
            ]
            comparer = Comparer(args.threshold, replays)
            comparer.compare(mode="single")
            return
Beispiel #2
0
    def _run_map(self):

        args = self.args

        threshold = args.threshold
        stddevs = args.stddevs

        # if doing anything online, revalidate cache
        self.cacher.revalidate(args.map_id, self.users_info)

        if (args.map_id and args.user_id):  # passed both -m and -u but not -l
            replays2 = OnlineReplay.from_user_info(self.cacher, args.map_id,
                                                   self.users_info)
            comparer = Comparer(threshold,
                                args.silent,
                                self.replays_check,
                                replays2=replays2,
                                stddevs=stddevs)
            comparer.compare(mode="double")
            return

        if (args.map_id):  # only passed -m
            # get all 50 top replays
            replays = OnlineReplay.from_user_info(self.cacher, args.map_id,
                                                  self.users_info)
            comparer = Comparer(threshold,
                                args.silent,
                                replays,
                                stddevs=stddevs)
            comparer.compare(mode="single")
            return
Beispiel #3
0
    def _run_local(self):

        args = self.args
        # get all local user replays (used in every --local case)
        replays1 = [LocalReplay.from_path(osr_path) for osr_path in PATH_REPLAYS_USER]

        threshold = args.threshold
        stddevs = args.stddevs

        if(args.map_id and args.user_id):
            # compare every local replay with just the given user + map replay
            comparer = Comparer(threshold, args.silent, replays1, replays2=self.replays_check, stddevs=stddevs)
            comparer.compare(mode="double")
            return
        if(args.map_id):
            # compare every local replay with every leaderboard entry
            replays2 = OnlineReplay.from_user_info(self.cacher, args.map_id, self.users_info)
            comparer = Comparer(threshold, args.silent, replays1, replays2=replays2, stddevs=stddevs)
            comparer.compare(mode="double")
            return

        if(args.single):
            # checks every replay listed in PATH_REPLAYS_USER against every other replay there
            comparer = Comparer(threshold, stddevs, args.silent, replays1)
            comparer.compare(mode="single")
            return
        else:
            # checks every replay listed in PATH_REPLAYS_USER against every replay listed in PATH_REPLAYS_CHECK
            replays2 = [LocalReplay.from_path(osr_path) for osr_path in PATH_REPLAYS_CHECK]
            comparer = Comparer(threshold, args.silent, replays1, replays2=replays2, stddevs=stddevs)
            comparer.compare(mode="double")
            return
Beispiel #4
0
    def _run_verify(self):
        args = self.args

        map_id = self.args.verify[0]
        user1_id = self.args.verify[1]
        user2_id = self.args.verify[2]

        user1_info = Loader.user_info(map_id, user1_id)
        user2_info = Loader.user_info(map_id, user2_id)
        replay1 = OnlineReplay.from_user_info(self.cacher, map_id, user1_info)
        replay2 = OnlineReplay.from_user_info(self.cacher, map_id, user2_info)

        comparer = Comparer(args.threshold,
                            args.silent,
                            replay1,
                            replays2=replay2,
                            stddevs=args.stddevs)
        comparer.compare(mode="double")
Beispiel #5
0
def compare_models():
    c = Comparer(no_of_testcases=100, nb=nb, bw=bw)
    c.ready()
    c.compare()