Commit 839d7369 authored by Kento HASEGAWA's avatar Kento HASEGAWA
Browse files

First commit

parents
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+132 −0
Changes for .gitignore: 132 added lines, 0 removed lines.
Original line number Diff line number Diff line
### https://raw.github.com/github/gitignore/9d7ff09c7d38dce9ef03e7ea4dc908a622546757/Python.gitignore

# Project-specific files
/conf.json
/questions/*
!/questions/.gitkeep
/answers/*
!/answers/.gitkeep


# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json


### https://raw.github.com/github/gitignore/9d7ff09c7d38dce9ef03e7ea4dc908a622546757/Global/VisualStudioCode.gitignore

.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

LICENSE

0 → 100644
+674 −0

File added.

Preview size limit exceeded, changes collapsed.

README.md

0 → 100644
+26 −0
Changes for README.md: 26 added lines, 0 removed lines.
Original line number Diff line number Diff line
# ADC2019

Ensemble solver system for the algorithm design content in DA symposium 2019

## Environments

実際のソルバで使用している環境.

+ デバイス
    - Raspberry Pi 3 B+

+ ソフトウェア
    - Python >= 3.5 (通信プログラム)
        * Flask
        * gevent
        * gevent-websocket


## Our previous works

+ [adc2018-system](https://www.togawa.cs.waseda.ac.jp/gitlab/adc2018/adc2018-system)
* [pynq-router](https://github.com/kotarot/pynq-router)
* [nl-solver](https://github.com/kotarot/nl-solver)

## License
This software is released under GPL v3 License, see [LICENSE](LICENSE).

adc2019system.py

0 → 100644
+46 −0
Changes for adc2019system.py: 46 added lines, 0 removed lines.
Original line number Diff line number Diff line
#!python3
# ADC2019 system module

import json

from roles import Host, Solver

config = None
role = None

def init(args):
    
    if ('config' in args) and (args['config'] is not None):
        load_config(args['config'])

def load_config(path):
    global config
    global role
    
    with open(path, 'r') as fp:
        config = json.load(fp)

    if 'role' in config:
        set_role(config['role'], config)

def set_role(role_name, config_data):
    global role

    if role_name == 'host':
        role = Host(config_data)
    elif role_name == 'solver':
        role = Solver(config_data)

def call_api(method, cmd, params):

    if role is not None:
        return role.call_api(method, cmd, params)
    else:
        if cmd == 'role':
            if method == 'POST':
                set_role(params['role'], params)
                return {'role': role.type}
            else:
                return {'role': 'Undefined'}
        else:
            return None

answers/.gitkeep

0 → 100644
+0 −0

Empty file added.

Loading