def __init__(self, params):
     self.reporter = Reporter.Reporter("grid_search_results/" + file + "/" + self.__class__.__name__ + 'iter=' + str(amountOfiterations) + '_stopcrit' + str(stopIteratingAfter) + '_lambda=' + str(params["lam"]) + '_alpha=' + str(params["alpha"]) + '_k=' + str(params["k"]) + '_' + file)
     self.lam = params["lam"]
     self.alpha = params["alpha"]
     self.k = params["k"]
     self.distanceMatrix = []
     self.listMeans = np.zeros(shape=(amountOfiterations))
     self.stopIter = 0
    def print_report(self):

        self.clear_console()

        len_checked = True

        while len_checked:
            dialog = SecondWindow(self)
            dialog.exec_()
            if dialog.selection_parameter > 0:
                self.msg_date_filter = self.report_date_filter(
                    dialog.labeled_slider.sl.value())
                if len(self.topsis_copy_df) != 0:
                    len_checked = False
                    self.topsis_df = self.topsis_copy_df
                else:
                    for i in range(dialog.labeled_slider.sl.value() + 1, 4):
                        self.recommend_filter = self.report_date_filter(i)
                        if len(self.topsis_copy_df) != 0:
                            self.msg_date_filter_list.append(
                                self.recommend_filter)
                    self.get_info_message_text_by_code(16)
            else:
                self.get_info_message_text_by_code(6)
                return

        directory = str(QFileDialog.getExistingDirectory(self, "Save Reports"))

        if directory == '':
            self.get_info_message_text_by_code(6)
            return

        messagebox = TimerMessageBox(5, 3, self)
        messagebox.exec_()

        reporter = Reporter(appctext, directory, self.cluster_df,
                            self.msg_date_filter, self.initial_date)

        reporter.topsis_analyzer.transformer = self.transformer
        reporter.topsis_analyzer.topsis_df = self.topsis_df
        reporter.topsis_analyzer.city_distance_df = self.city_distance_df
        reporter.topsis_analyzer.city_df = self.city_df

        self.results_df = reporter.create_report()
        self.get_info_message_text_by_code(12)

        self.display_results(overall=True)
        _translate = QtCore.QCoreApplication.translate
        self.label_8.setText(
            _translate(
                "PyTOP",
                "<html><head/><body><p align=\"center\"><span style=\" font-size:14pt; "
                "font-weight:600;\">Adjuster Overall Rankings</span></p></body></html>"
            ))
        self.Push_Btn_RUN_CLASSIFICATION_NEW_ACCIDENT.setStyleSheet(
            "background-color: lightgray")
        self.Push_Btn_RUN.setStyleSheet("background-color: lightgray")
        self.Push_Btn_RESET.setStyleSheet("background-color: lightgray")
예제 #3
0
파일: r0829194.py 프로젝트: macakpav/tsp
    def __init__(self):
        self.reporter = Reporter.Reporter(self.__class__.__name__)
        self.population = []
        self.offspring = []
        self.dist_matrix = []
        self.no_cities = 0
        self.pop_size = 200  # desired lambda size
        self.no_offspring = self.pop_size * 3  # offspring generation size
        self.tolerance = 1e-2
        self.checkInterval = 10
        self.iteration = 0
        self.timing = 0
        self.c = 1  # to increase size of 2-opt for best individuals
        self.stop_time = 30  # max time left for the last local search

        # METHODS
        self.initialization = self.initialization_smart
        self.selection = self.selection_round_robin
        self.recombination = self.recombination_SCX
        self.mutation = self.mutation_all_keep_better
        self.local_search = self.lopt_two_opt_all
        self.elimination = self.elimination_round_robin_k_crowding

        # META parameters

        # selection
        # round robin selection
        self.round_robin_q_selection = int(self.pop_size * 0.1)

        # recombination
        # -

        # mutation
        self.init_mut_prob_flip = 0.4  # initial probability of flip mutation
        self.init_mut_prob_shuf = 0.25  # initial probability of shuffle mutation
        self.min_mut_prob = 0.01  # minimal mutation probability for all
        self.mut_boost_treshold = 0.1  # with lower mutation average a boost will ocur
        # mutation gets boosted by Coef * Init_mut_prob
        self.mut_boost_coefficient = 0.5

        # local optimization
        self.two_opt_subinterval_size = int(self.pop_size * 0.2)

        # elimination
        self.crowding_k = int(
            (self.pop_size + self.no_offspring) * 0.3)  # k-tournament crowding
        # number of individuals poped due to crowding
        self.crowding_pop_count = min(self.pop_size, self.no_offspring)
        self.round_robin_q_elimination = int(self.pop_size *
                                             0.15)  # round robin elimination
예제 #4
0
from configuration import Conf
from test_details import ReportElementStatus, ReportElementType
from time import localtime, strftime
import time
import Reporter as Difido

difido_suite_name = None  # type: str
difido_test_name = None  # type: str
testAttr = {}
reporter = Difido.Reporter()
config_file = "config.cfg"
automation_ver = "Some version Here"

def pytest_runtest_setup(item):
    global current_test_number
    global testAttr
    testAttr = {'starttime': strftime("%Y%m%d %H:%M:%S", localtime()), 'doc': "",
                'className': item.nodeid.split("::")[1].replace("Test", "")}
    testname = item.name.replace("test_", "")
    reporter.start_test(testname, testAttr)

def pytest_runtest_logreport(report):
    if report.when == 'call':
        if report.outcome == 'failed':
            testAttr['status'] = ReportElementStatus.ERROR
            reporter.report("", "<pre>" + str(report.longreprtext) + "</pre>", element_type=ReportElementType.HTML,
                            status=ReportElementStatus.ERROR)
        else:
            testAttr['status'] = ReportElementStatus.SUCCESS

        time.sleep(1)
            print(us,"vs",adversary)
            runAuctions(generateBotList(us,adversary,num_advertisers))


def runMultipleBotCombinationsAuctions2():
    #execution
    for us in all_bots_list:
        for adversary in all_bots_list:
            print(us,"vs",adversary)
            runAuctions(generateBotList(us,adversary,num_advertisers))

def runAllSameBotAuctions():
    for bot_type in all_bots_list:
        print("Running ",bot_type)
        runAuctions(generateBotList(bot_type,bot_type,num_advertisers))


no = randint(1,1000)
rep = Reporter()
rep.executionNumber = no
print("Executing ",no)
printAuctionSettings(no,num_advertisers+1,minSlots,maxSlots,minValue,maxValue,minBudget,maxBudget,nAuctions,max_step,isVCG)

# runMultipleBotCombinationsAuctions()
# runMultipleBotCombinationsAuctions2()
# runAllBotsAuction()
# runSingleBotCombinationAuction()
runAllSameBotAuctions()

print("Executed ",no)
예제 #6
0
 def __init__(self):
     self.reporter = Reporter.Reporter(self.__class__.__name__)
예제 #7
0
class Test(object):
    report: Difido.Reporter = Difido.Reporter()
예제 #8
0
 def callApendFile(self, path, KeywordName, expected, actual, imgPath,
                   count):
     report = Reporter.Reporter()
     report.apendFile(path, KeywordName, expected, actual, imgPath, count)
예제 #9
0
 def callCreateFile(self, path):
     report = Reporter.Reporter()
     report.createFile(path)
예제 #10
0
from auto_Data import *
from BronKerbosch import bronker_bosch1
from PivotBronKerbosch import bronker_bosch2
from Reporter import *

if __name__ == '__main__':
    funcs = [bronker_bosch1, bronker_bosch2]

    for func in funcs:
        report = Reporter(func)
        func([], set(NODES), set(), report)
        report.print_report()
        report.export_report()
예제 #11
0
파일: Render.py 프로젝트: rwal127/Qube
    def monitorRender(self):
        statusbar = ""

        # Start the Reporter Thread for Qube
        queue = Queue.Queue()  # Store the qube updates to be processed
        # Start 1 threads for now
        for i in range(0, 1):
            reporter = Reporter.Reporter(queue)
            reporter.setDaemon(True)  # Set it to run continuosly
            reporter.start()  # Spawn the thread
        self.logger.info("Reporter Thread Started")

        while True:
            # Read the input
            stdOut = self.proc.stdout.readline()
            if not stdOut: break

            # Write the actual output line
            sys.stdout.write(stdOut)
            sys.stdout.flush()

            # ------------------------------------------------------------------------------
            # Retrieve the info from each line of output
            # ------------------------------------------------------------------------------

            # Get the current frame, if unavailable, check for other parameters
            self.job.prevFrame = self.job.currFrame
            result = self.reSearch(
                '(?<=^PROGRESS:  )(?:\(Skipping \d+\)|\d+?|\d;.*?) \((.*?)\).*$',
                stdOut)
            if result != "": self.job.currFrame = result

            # Get the start Frame
            if self.job.start == "":
                self.job.start = self.reSearch(
                    '(?<=PROGRESS:  Start: )(.+?)\n', stdOut)

            # Get the end Frame
            elif self.job.end == "":
                self.job.end = self.reSearch('(?<=PROGRESS:  End: )(.+?)\n',
                                             stdOut)

            # Get the duration
            elif self.job.duration == "":
                self.job.duration = self.reSearch(
                    '(?<=PROGRESS:  Duration: )(.+?)\n', stdOut)

            # Print the status bar every # of frames
            if (self.job.currFrame != ""
                    and (int(self.job.currFrame) % STATUSFREQUENCY)
                    == (STATUSFREQUENCY - 1)
                    and self.job.currFrame != self.job.prevFrame):

                # ----------------------------------------------------------------------------------
                # Write the statusbar
                #
                # % CURRFRAME/TOTALFRAMES - Avg: FRAMEAVG - Elapsed: ELAPSED - Remaining: REMAINING
                # ----------------------------------------------------------------------------------

                statusbar = "PROGRESS:  " + str(
                    self.job.getPercentComplete()) + "%"
                statusbar += " " + str(self.job.currFrame) + "/" + str(
                    self.job.duration)
                statusbar += " - Avg:" + self.convertSecToTime(
                    self.job.getFrameAvg())
                statusbar += " - Elapsed:" + self.convertSecToTime(
                    self.job.getElapsedTime())
                statusbar += " - Remaining:" + self.convertSecToTime(
                    self.job.getRemainingTime())
                statusbar += "\n"

                sys.stdout.write(statusbar)
                sys.stdout.flush()

            # Update Qube if frames have changed
            if (self.job.prevFrame != self.job.currFrame):
                queue.put(self.job.getPercentComplete())

        # Wait for the Qube Updates to be processed
        queue.join()

        self.job.setComplete()  # Store the end time

        self.logger.info("Exit Code: " + str(self.proc.returncode))
        sys.exit(self.proc.returncode)