Beispiel #1
0
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        self.setupUi(self)
        self.action_system_quit.triggered.connect(self.on_exit)
        self.action_system_restart.triggered.connect(self.on_restart)
        self.action_system_start.triggered.connect(self.on_start)
        self.action_cmd.triggered.connect(self.show_cmd)
        self.action_file.triggered.connect(self.show_file)
        self.action_process.triggered.connect(self.show_process)
        self.action_ctlSettings.triggered.connect(
            self.show_controller_settings)
        self.action_svrSettings.triggered.connect(self.show_server_settings)

        self.table.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
        self.table.setEditTriggers(QAbstractItemView.NoEditTriggers)
        self.table.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.table.customContextMenuRequested.connect(self._right_menu)
        XStream.stdout().messageWritten.connect(self.textEdit.insertPlainText)
        XStream.stderr().messageWritten.connect(self.textEdit.insertPlainText)
        logger.info('[*] Load system config')
        self.conf = Config('system.ini')
        self.system = None
        self.thread_pool = QThreadPool()
        self.process = QProcess(self)
        self.process.readyRead.connect(self.data_ready)
        # self.process.waitForStarted(1)
        self.process.started.connect(lambda: self.write_data('help'))
        self.process.error.connect(self.on_error)
        # self.textEdit.textChanged.connect(lambda: self.write_data(self.textEdit.document()))
        # self.textEdit.textChanged.connect(lambda: print(self.textEdit.toPlainText()))
        # self.process.finished.connect(lambda: self.runButton.setEnabled(True))

        self.process_manager = WorkerManager(max_threads=4)
Beispiel #2
0
import pandas as pd
from controller.config import Config
from controller.data_label_utils import get_all_sentiment_labels
from controller.database_service import DatabaseService
from controller.ml_utils import MLUtils

config = Config()
dbs = DatabaseService(config)

# get databases
collection_names = ['sickhillary', 'baghdadi_dead', 'death_hoax']

# declare test parameters
description = "Experiment 2"
n_iterations_per_classifier = 100
test_ratio = 0.2
target_label = "tweet_sentiment_label"
classifier_dict = MLUtils.get_classifiers_standard_suite()
features_tested_dict = {'feature_nlp_afinn_swn': MLUtils.gen_feature_afinn_swn,
                        'feature_nlp_pos': MLUtils.gen_feature_pos,
                        'feature_term_tfidf': MLUtils.gen_feature_term_tfidf}

ml_collections_result = {}

# iterate through collections
for collection_name in collection_names:
    print("Collection: " + collection_name)
    # get labelled tweets (unique)
    mongo_search_query = {"tweet_sentiment_label": {"$exists": True}}
    mongo_filter_query = {"text": 1, "tweet_type": 1, "tweet_sentiment_label": 1}
    mongo_filter_query.update({label: 1 for label in get_all_sentiment_labels()})
Beispiel #3
0
    print "    ||     ||     |___|     "
    print " ___||_____||____|_____|____"
    print ""
    print "############################"
    print ""


if __name__ == '__main__':
    # Moveit! initialise and init node
    moveit_commander.roscpp_initialize(sys.argv)
    rospy.init_node('cobra_towers_of_hanoi', anonymous=True)

    # welcome screen
    show_tower_of_hanoi()

    config = Config(MAX_GRIPPER, NUMBER_OF_DISKS, DISK_HEIGHT, TOWER_HEIGHT,
                    TOWER_POSITION, DIFFERENT_HEIGHT_OF_TOWERS, DEBUG)

    # configure and initialise objects
    controller = Controller(config, DEBUG)

    # initialise planning scene
    world = World(controller.tower_array, controller.disk_array, config, DEBUG)

    # remove old objects from scene
    world.clean_up()

    # add new objects
    world.create_planning_scene()

    # start the game
    controller.tower_of_hanoi(world)