Compare commits
44 Commits
adamT_bran
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
21021ea59a | ||
a7d3f0b356 | |||
|
e6363ef448 | ||
|
8897568fa9 | ||
f895a4b637 | |||
|
07d81b4553 | ||
|
0186ef8e00 | ||
|
f5e403b331 | ||
|
0bfeeb2486 | ||
|
6dbec012a7 | ||
|
1be0ecff48 | ||
|
23b85d2549 | ||
|
723568cf31 | ||
|
87483f5838 | ||
|
be49eb4d00 | ||
|
a2e474d520 | ||
|
90a9644a32 | ||
7b4d017549 | |||
2f7c3d87ce | |||
82dae22676 | |||
172f97bc8c | |||
56689faa23 | |||
fbbd929259 | |||
a45ebf5e92 | |||
79d7b98752 | |||
a9797d7599 | |||
5ea5322cbc | |||
840b9e7afc | |||
7611d2309c | |||
1f167f28cd | |||
aa3fb8c414 | |||
dba30bae63 | |||
|
c0f5a8f7f7 | ||
|
914e9404f0 | ||
|
c39818df87 | ||
2ded95f69c | |||
760f2607e2 | |||
a3a6c95649 | |||
8b39625137 | |||
1cdb80aa96 | |||
552a3adf1e | |||
4621853e1b | |||
9e6dc4d628 | |||
|
b9f720e0c7 |
53
.gitignore
vendored
@ -1,8 +1,3 @@
|
|||||||
|
|
||||||
# Created by https://www.gitignore.io/api/python
|
|
||||||
# Edit at https://www.gitignore.io/?templates=python
|
|
||||||
|
|
||||||
### Python ###
|
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
@ -25,13 +20,10 @@ parts/
|
|||||||
sdist/
|
sdist/
|
||||||
var/
|
var/
|
||||||
wheels/
|
wheels/
|
||||||
pip-wheel-metadata/
|
|
||||||
share/python-wheels/
|
share/python-wheels/
|
||||||
*.egg-info/
|
*.egg-info/
|
||||||
.installed.cfg
|
.installed.cfg
|
||||||
*.egg
|
*.egg
|
||||||
|
|
||||||
/idea/workspace.xml
|
|
||||||
MANIFEST
|
MANIFEST
|
||||||
|
|
||||||
# PyInstaller
|
# PyInstaller
|
||||||
@ -54,24 +46,31 @@ htmlcov/
|
|||||||
nosetests.xml
|
nosetests.xml
|
||||||
coverage.xml
|
coverage.xml
|
||||||
*.cover
|
*.cover
|
||||||
|
*.py,cover
|
||||||
.hypothesis/
|
.hypothesis/
|
||||||
.pytest_cache/
|
.pytest_cache/
|
||||||
|
cover/
|
||||||
|
|
||||||
# Translations
|
# Translations
|
||||||
*.mo
|
*.mo
|
||||||
*.pot
|
*.pot
|
||||||
|
|
||||||
# Scrapy stuff:
|
|
||||||
.scrapy
|
|
||||||
|
|
||||||
# Sphinx documentation
|
|
||||||
docs/_build/
|
|
||||||
|
|
||||||
# PyBuilder
|
# PyBuilder
|
||||||
|
.pybuilder/
|
||||||
target/
|
target/
|
||||||
|
|
||||||
|
# Jupyter Notebook
|
||||||
|
.ipynb_checkpoints
|
||||||
|
|
||||||
|
# IPython
|
||||||
|
profile_default/
|
||||||
|
ipython_config.py
|
||||||
|
|
||||||
# pyenv
|
# pyenv
|
||||||
.python-version
|
# For a library or package, you might want to ignore these files since the code is
|
||||||
|
# intended to run in multiple environments; otherwise, check them in:
|
||||||
|
# .python-version
|
||||||
|
|
||||||
# pipenv
|
# pipenv
|
||||||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
||||||
@ -80,12 +79,25 @@ target/
|
|||||||
# install all needed dependencies.
|
# install all needed dependencies.
|
||||||
#Pipfile.lock
|
#Pipfile.lock
|
||||||
|
|
||||||
# celery beat schedule file
|
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
||||||
|
__pypackages__/
|
||||||
|
|
||||||
|
# Celery stuff
|
||||||
celerybeat-schedule
|
celerybeat-schedule
|
||||||
|
celerybeat.pid
|
||||||
|
|
||||||
# SageMath parsed files
|
# SageMath parsed files
|
||||||
*.sage.py
|
*.sage.py
|
||||||
|
|
||||||
|
# Environments
|
||||||
|
.env
|
||||||
|
.venv
|
||||||
|
env/
|
||||||
|
venv/
|
||||||
|
ENV/
|
||||||
|
env.bak/
|
||||||
|
venv.bak/
|
||||||
|
|
||||||
# Spyder project settings
|
# Spyder project settings
|
||||||
.spyderproject
|
.spyderproject
|
||||||
.spyproject
|
.spyproject
|
||||||
@ -93,11 +105,6 @@ celerybeat-schedule
|
|||||||
# Rope project settings
|
# Rope project settings
|
||||||
.ropeproject
|
.ropeproject
|
||||||
|
|
||||||
# Mr Developer
|
|
||||||
.mr.developer.cfg
|
|
||||||
.project
|
|
||||||
.pydevproject
|
|
||||||
|
|
||||||
# mkdocs documentation
|
# mkdocs documentation
|
||||||
/site
|
/site
|
||||||
|
|
||||||
@ -109,4 +116,8 @@ dmypy.json
|
|||||||
# Pyre type checker
|
# Pyre type checker
|
||||||
.pyre/
|
.pyre/
|
||||||
|
|
||||||
# End of https://www.gitignore.io/api/python
|
# pytype static type analyzer
|
||||||
|
.pytype/
|
||||||
|
|
||||||
|
# Cython debug symbols
|
||||||
|
cython_debug/
|
@ -1,11 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<module type="PYTHON_MODULE" version="4">
|
<module type="PYTHON_MODULE" version="4">
|
||||||
<component name="NewModuleRootManager">
|
<component name="NewModuleRootManager">
|
||||||
<content url="file://$MODULE_DIR$" />
|
<content url="file://$MODULE_DIR$">
|
||||||
<orderEntry type="inheritedJdk" />
|
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="jdk" jdkName="Python 3.7 (ProjektAI)" jdkType="Python SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
<component name="TestRunnerService">
|
|
||||||
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
|
|
||||||
</component>
|
|
||||||
</module>
|
</module>
|
@ -3,4 +3,5 @@
|
|||||||
<component name="JavaScriptSettings">
|
<component name="JavaScriptSettings">
|
||||||
<option name="languageLevel" value="ES6" />
|
<option name="languageLevel" value="ES6" />
|
||||||
</component>
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (ProjektAI)" project-jdk-type="Python SDK" />
|
||||||
</project>
|
</project>
|
26
README.md
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
## Table of contents
|
||||||
|
* [General info](#general-info)
|
||||||
|
* [Technologies](#technologies)
|
||||||
|
* [Setup](#setup)
|
||||||
|
|
||||||
|
## General info
|
||||||
|
This is AI project of autonomic waiter that recognizes images of placed ordes with CNN algorithm. Orders are generated using the decision tree algoritm while tables by generic algorithm.
|
||||||
|
|
||||||
|
Table of contents
|
||||||
|
* [General info](#general-info)
|
||||||
|
* [Technologies](#technologies)
|
||||||
|
* [Setup](#setup)
|
||||||
|
|
||||||
|
## Technologies
|
||||||
|
Project is created with:
|
||||||
|
* Python 64-bit: 3.6
|
||||||
|
* Tensorflow: 2.0.0
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
The `requirements.txt` file should list all Python libraries that your notebooks
|
||||||
|
depend on, and they will be installed using:
|
||||||
|
|
||||||
|
```
|
||||||
|
pip install -r requirements.txt
|
||||||
|
```
|
||||||
|
|
@ -1,6 +0,0 @@
|
|||||||
<component name="InspectionProjectProfileManager">
|
|
||||||
<settings>
|
|
||||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
|
||||||
<version value="1.0" />
|
|
||||||
</settings>
|
|
||||||
</component>
|
|
@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="PYTHON_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager">
|
|
||||||
<content url="file://$MODULE_DIR$" />
|
|
||||||
<orderEntry type="jdk" jdkName="Python 3.7 (kelner)" jdkType="Python SDK" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
<component name="TestRunnerService">
|
|
||||||
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="JavaScriptSettings">
|
|
||||||
<option name="languageLevel" value="ES6" />
|
|
||||||
</component>
|
|
||||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (kelner)" project-jdk-type="Python SDK" />
|
|
||||||
</project>
|
|
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/kelner.iml" filepath="$PROJECT_DIR$/.idea/kelner.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,199 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ChangeListManager">
|
|
||||||
<list default="true" id="4be2149b-d9bc-4e21-8365-293320ae7f92" name="Default Changelist" comment="stoły mają 4 stany. Status gotowy do złożenia zamówienia ustawiany jest w nowym wątku w klasie TaskManager co 3 sekundy dla jednego stolika, kelner moze odbierać zamówienia od stolików gotowych do ich złożenia">
|
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
|
||||||
</list>
|
|
||||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
||||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
||||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
||||||
</component>
|
|
||||||
<component name="FileTemplateManagerImpl">
|
|
||||||
<option name="RECENT_TEMPLATES">
|
|
||||||
<list>
|
|
||||||
<option value="Python Script" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
<component name="Git.Settings">
|
|
||||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
|
|
||||||
</component>
|
|
||||||
<component name="ProjectId" id="1ZSC25l5bE6jvUIMcW31QzsqTTN" />
|
|
||||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
|
|
||||||
<ConfirmationsSetting value="2" id="Add" />
|
|
||||||
</component>
|
|
||||||
<component name="PropertiesComponent">
|
|
||||||
<property name="ASKED_ADD_EXTERNAL_FILES" value="true" />
|
|
||||||
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
|
|
||||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
|
||||||
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
|
||||||
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
|
|
||||||
</component>
|
|
||||||
<component name="RecentsManager">
|
|
||||||
<key name="MoveFile.RECENT_KEYS">
|
|
||||||
<recent name="J:\PycharmProjects\kelner\src\components" />
|
|
||||||
<recent name="J:\PycharmProjects\kelner\images" />
|
|
||||||
<recent name="J:\PycharmProjects\kelner" />
|
|
||||||
</key>
|
|
||||||
</component>
|
|
||||||
<component name="RunDashboard">
|
|
||||||
<option name="ruleStates">
|
|
||||||
<list>
|
|
||||||
<RuleState>
|
|
||||||
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
|
|
||||||
</RuleState>
|
|
||||||
<RuleState>
|
|
||||||
<option name="name" value="StatusDashboardGroupingRule" />
|
|
||||||
</RuleState>
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
<component name="RunManager">
|
|
||||||
<configuration name="main" type="PythonConfigurationType" factoryName="Python" temporary="true">
|
|
||||||
<module name="kelner" />
|
|
||||||
<option name="INTERPRETER_OPTIONS" value="" />
|
|
||||||
<option name="PARENT_ENVS" value="true" />
|
|
||||||
<envs>
|
|
||||||
<env name="PYTHONUNBUFFERED" value="1" />
|
|
||||||
</envs>
|
|
||||||
<option name="SDK_HOME" value="" />
|
|
||||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
|
||||||
<option name="IS_MODULE_SDK" value="true" />
|
|
||||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
|
||||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
|
||||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
|
||||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/main.py" />
|
|
||||||
<option name="PARAMETERS" value="" />
|
|
||||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
|
||||||
<option name="EMULATE_TERMINAL" value="false" />
|
|
||||||
<option name="MODULE_MODE" value="false" />
|
|
||||||
<option name="REDIRECT_INPUT" value="false" />
|
|
||||||
<option name="INPUT_FILE" value="" />
|
|
||||||
<method v="2" />
|
|
||||||
</configuration>
|
|
||||||
<recent_temporary>
|
|
||||||
<list>
|
|
||||||
<item itemvalue="Python.main" />
|
|
||||||
</list>
|
|
||||||
</recent_temporary>
|
|
||||||
</component>
|
|
||||||
<component name="SvnConfiguration">
|
|
||||||
<configuration />
|
|
||||||
</component>
|
|
||||||
<component name="TaskManager">
|
|
||||||
<task active="true" id="Default" summary="Default task">
|
|
||||||
<changelist id="4be2149b-d9bc-4e21-8365-293320ae7f92" name="Default Changelist" comment="" />
|
|
||||||
<created>1584822897275</created>
|
|
||||||
<option name="number" value="Default" />
|
|
||||||
<option name="presentableId" value="Default" />
|
|
||||||
<updated>1584822897275</updated>
|
|
||||||
<workItem from="1584822899496" duration="10270000" />
|
|
||||||
<workItem from="1584835781926" duration="189000" />
|
|
||||||
<workItem from="1584889217128" duration="21436000" />
|
|
||||||
<workItem from="1584912093524" duration="666000" />
|
|
||||||
<workItem from="1584986159947" duration="1123000" />
|
|
||||||
<workItem from="1585006246801" duration="264000" />
|
|
||||||
<workItem from="1585247780368" duration="715000" />
|
|
||||||
<workItem from="1585257395176" duration="8541000" />
|
|
||||||
<workItem from="1585864729460" duration="241000" />
|
|
||||||
<workItem from="1585939347531" duration="8682000" />
|
|
||||||
<workItem from="1585948578229" duration="795000" />
|
|
||||||
<workItem from="1585950329643" duration="151000" />
|
|
||||||
<workItem from="1585950592457" duration="1447000" />
|
|
||||||
<workItem from="1586011803812" duration="407000" />
|
|
||||||
<workItem from="1586015125508" duration="1424000" />
|
|
||||||
<workItem from="1586025614413" duration="11394000" />
|
|
||||||
<workItem from="1586089047557" duration="6590000" />
|
|
||||||
<workItem from="1586098345503" duration="112000" />
|
|
||||||
<workItem from="1586098478408" duration="902000" />
|
|
||||||
<workItem from="1586110377593" duration="1935000" />
|
|
||||||
<workItem from="1586119136965" duration="6415000" />
|
|
||||||
<workItem from="1586171095013" duration="3851000" />
|
|
||||||
<workItem from="1586175311822" duration="1170000" />
|
|
||||||
<workItem from="1586177130146" duration="43000" />
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00001" summary="klasa kelner">
|
|
||||||
<created>1584889744892</created>
|
|
||||||
<option name="number" value="00001" />
|
|
||||||
<option name="presentableId" value="LOCAL-00001" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1584889744892</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00002" summary="klasa kelner">
|
|
||||||
<created>1584910332507</created>
|
|
||||||
<option name="number" value="00002" />
|
|
||||||
<option name="presentableId" value="LOCAL-00002" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1584910332507</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00003" summary="klasa kelner">
|
|
||||||
<created>1584910685304</created>
|
|
||||||
<option name="number" value="00003" />
|
|
||||||
<option name="presentableId" value="LOCAL-00003" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1584910685304</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00004" summary="klasa kelner">
|
|
||||||
<created>1585257603366</created>
|
|
||||||
<option name="number" value="00004" />
|
|
||||||
<option name="presentableId" value="LOCAL-00004" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1585257603366</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00005" summary="dodano manager rysujący wszystkie obiekty, kelner rozpoznaje kolizje ze stołami">
|
|
||||||
<created>1585950875511</created>
|
|
||||||
<option name="number" value="00005" />
|
|
||||||
<option name="presentableId" value="LOCAL-00005" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1585950875511</updated>
|
|
||||||
</task>
|
|
||||||
<option name="localTasksCounter" value="6" />
|
|
||||||
<servers />
|
|
||||||
</component>
|
|
||||||
<component name="TypeScriptGeneratedFilesManager">
|
|
||||||
<option name="version" value="1" />
|
|
||||||
</component>
|
|
||||||
<component name="Vcs.Log.Tabs.Properties">
|
|
||||||
<option name="TAB_STATES">
|
|
||||||
<map>
|
|
||||||
<entry key="MAIN">
|
|
||||||
<value>
|
|
||||||
<State>
|
|
||||||
<option name="COLUMN_ORDER" />
|
|
||||||
</State>
|
|
||||||
</value>
|
|
||||||
</entry>
|
|
||||||
</map>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
<component name="VcsManagerConfiguration">
|
|
||||||
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
|
|
||||||
<MESSAGE value="klasa kelner" />
|
|
||||||
<MESSAGE value="dodano manager rysujący wszystkie obiekty, kelner rozpoznaje kolizje ze stołami" />
|
|
||||||
<MESSAGE value="stoły mają 4 stany. Status gotowy do złożenia zamówienia ustawiany jest w nowym wątku w klasie TaskManager co 3 sekundy dla jednego stolika, kelner moze odbierać zamówienia od stolików gotowych do ich złożenia" />
|
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="stoły mają 4 stany. Status gotowy do złożenia zamówienia ustawiany jest w nowym wątku w klasie TaskManager co 3 sekundy dla jednego stolika, kelner moze odbierać zamówienia od stolików gotowych do ich złożenia" />
|
|
||||||
</component>
|
|
||||||
<component name="XDebuggerManager">
|
|
||||||
<breakpoint-manager>
|
|
||||||
<breakpoints>
|
|
||||||
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
|
||||||
<url>file://$PROJECT_DIR$/src/managers/DrawableCollection.py</url>
|
|
||||||
<line>71</line>
|
|
||||||
<option name="timeStamp" value="8" />
|
|
||||||
</line-breakpoint>
|
|
||||||
</breakpoints>
|
|
||||||
<default-breakpoints>
|
|
||||||
<breakpoint type="python-exception">
|
|
||||||
<properties notifyOnTerminate="true" exception="BaseException">
|
|
||||||
<option name="notifyOnTerminate" value="true" />
|
|
||||||
</properties>
|
|
||||||
</breakpoint>
|
|
||||||
</default-breakpoints>
|
|
||||||
</breakpoint-manager>
|
|
||||||
</component>
|
|
||||||
<component name="com.intellij.coverage.CoverageDataManagerImpl">
|
|
||||||
<SUITE FILE_PATH="coverage/kelner$main.coverage" NAME="main Coverage Results" MODIFIED="1586177139696" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
104
kelner/gui/GAdialog/GADefaults.py
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
|
||||||
|
class CrossingOverMethod:
|
||||||
|
FixedQuadrant = 0
|
||||||
|
SingleHorizontalDiv = 1
|
||||||
|
SingleVerticalDiv = 2
|
||||||
|
DoubleHorizontalDiv = 3
|
||||||
|
DoubleVerticalDiv = 4
|
||||||
|
RandomChoice = 5
|
||||||
|
|
||||||
|
|
||||||
|
class SelectionMethod:
|
||||||
|
Roulette = 0
|
||||||
|
Tournament = 1
|
||||||
|
|
||||||
|
|
||||||
|
class MutationMethod:
|
||||||
|
Flip = 0
|
||||||
|
Swap = 1
|
||||||
|
|
||||||
|
|
||||||
|
class GADefaults:
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
|
||||||
|
self.defSelectionMethods = [("ruletka", SelectionMethod.Roulette),
|
||||||
|
("turniej", SelectionMethod.Tournament)]
|
||||||
|
|
||||||
|
self.defCrossingOverMethods = [("pojedynczy poziomy", CrossingOverMethod.SingleHorizontalDiv),
|
||||||
|
("pojedynczy pionowy", CrossingOverMethod.SingleVerticalDiv),
|
||||||
|
("podwójny poziomy", CrossingOverMethod.DoubleHorizontalDiv),
|
||||||
|
("podwójny pionowy", CrossingOverMethod.DoubleVerticalDiv),
|
||||||
|
("ćwiartki", CrossingOverMethod.FixedQuadrant),
|
||||||
|
("losowe", CrossingOverMethod.RandomChoice)]
|
||||||
|
|
||||||
|
self.defMutationMethods = [("inwersja", MutationMethod.Flip),
|
||||||
|
("wymiana", MutationMethod.Swap)]
|
||||||
|
|
||||||
|
self.windowName = "Algorytm genetyczny - parametry"
|
||||||
|
self.windowGeometry = "400x400"
|
||||||
|
|
||||||
|
self.minTablesCount = 1
|
||||||
|
self.maxTablesCount = 100
|
||||||
|
self.defTablesCount = 20
|
||||||
|
self.runTablesCount = self.defTablesCount
|
||||||
|
self.sliderNameTablesCount = "stoliki"
|
||||||
|
|
||||||
|
self.minPopulationSize = 4
|
||||||
|
self.maxPopulationSize = 30
|
||||||
|
self.defPopulationSize = 5
|
||||||
|
self.runPopulationSize = self.defPopulationSize
|
||||||
|
self.sliderNamePopulationSize = "populacja"
|
||||||
|
|
||||||
|
self.minMutation = 0
|
||||||
|
self.maxMutation = 10
|
||||||
|
self.defMutation = 1
|
||||||
|
self.runMutation = self.defMutation
|
||||||
|
self.sliderNameMutation = "mutacje"
|
||||||
|
|
||||||
|
self.minGenerationsNumber = 1
|
||||||
|
self.maxGenerationsNumber = 1000
|
||||||
|
self.defGenerationsNumber = 20
|
||||||
|
self.runGenerationsNumber = self.defGenerationsNumber
|
||||||
|
self.sliderNameGenerationsNumber = "pokolenia"
|
||||||
|
|
||||||
|
self.defInfoFold = 5
|
||||||
|
self.runInfoFold = self.defInfoFold
|
||||||
|
self.sliderInfoFold = "co ile"
|
||||||
|
|
||||||
|
self.defSelectionMethod = SelectionMethod.Tournament
|
||||||
|
self.runSelectionMethod = self.defSelectionMethod
|
||||||
|
self.radioSelectionMethodName = "metoda selekcji"
|
||||||
|
|
||||||
|
self.defCrossingOverMethod = CrossingOverMethod.SingleHorizontalDiv
|
||||||
|
self.runCrossingOverMethod = self.defCrossingOverMethod
|
||||||
|
self.radioCrossingOverMethodName = "metoda krzyżowania"
|
||||||
|
|
||||||
|
self.defMutationMethod = MutationMethod.Swap
|
||||||
|
self.runMutationMethod = self.defMutationMethod
|
||||||
|
self.radioMutationMethodName = "metoda mutacji"
|
||||||
|
|
||||||
|
self.minElitism = 0
|
||||||
|
self.maxElitism = 50
|
||||||
|
self.defElitism = 0
|
||||||
|
self.runElitism = self.defElitism
|
||||||
|
self.sliderElitismName = "elitarność [%]"
|
||||||
|
|
||||||
|
self.buttonStartName = "generuj"
|
||||||
|
self.buttonDefaultsName = "przywróć"
|
||||||
|
|
||||||
|
self.__forbiddenPlaces = None
|
||||||
|
|
||||||
|
self.waiterPosition = None
|
||||||
|
self.kitchenPosition = None
|
||||||
|
|
||||||
|
def getForbiddenPlaces(self):
|
||||||
|
if self.__forbiddenPlaces is None:
|
||||||
|
self.__forbiddenPlaces = [self.waiterPosition, self.kitchenPosition]
|
||||||
|
return self.__forbiddenPlaces
|
||||||
|
|
||||||
|
def getInfo(self):
|
||||||
|
return "populacja: " + str(self.runPopulationSize) \
|
||||||
|
+ ", pokolenia: " + str(self.runGenerationsNumber) \
|
||||||
|
+ ", stoliki: " + str(self.runTablesCount) \
|
||||||
|
+ ", mutacje: " + str(self.runMutation)
|
82
kelner/gui/GAdialog/GADialog.py
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
import tkinter
|
||||||
|
from tkinter import *
|
||||||
|
|
||||||
|
from kelner.gui.GAdialog.GADefaults import CrossingOverMethod
|
||||||
|
|
||||||
|
|
||||||
|
class GADialog:
|
||||||
|
|
||||||
|
def __init__(self, defaults):
|
||||||
|
self.__defaults = defaults
|
||||||
|
self.window = tkinter.Tk()
|
||||||
|
self.window.attributes('-topmost', 'true')
|
||||||
|
self.window.title(defaults.windowName)
|
||||||
|
self.__sliderTablesCount = self.__getSlider(0, defaults.minTablesCount, defaults.maxTablesCount, defaults.runTablesCount, defaults.sliderNameTablesCount)
|
||||||
|
self.__sliderPopulationSize = self.__getSlider(1, defaults.minPopulationSize, defaults.maxPopulationSize, defaults.runPopulationSize, defaults.sliderNamePopulationSize)
|
||||||
|
self.__sliderMutation = self.__getSlider(2, defaults.minMutation, defaults.maxMutation, defaults.runMutation, defaults.sliderNameMutation)
|
||||||
|
self.__sliderGenerationsNumber = self.__getSlider(3, defaults.minGenerationsNumber, defaults.maxGenerationsNumber, defaults.runGenerationsNumber, defaults.sliderNameGenerationsNumber)
|
||||||
|
self.__sliderInfoFold = self.__getSlider(4, defaults.minGenerationsNumber, defaults.maxGenerationsNumber, defaults.runInfoFold, defaults.sliderInfoFold)
|
||||||
|
self.__sliderElitism = self.__getSlider(5, defaults.minElitism, defaults.maxElitism, defaults.runElitism, defaults.sliderElitismName)
|
||||||
|
|
||||||
|
self.__radioSelectionMethodValue = IntVar()
|
||||||
|
self.__radioSelectionMethodValue.set(self.__defaults.runSelectionMethod)
|
||||||
|
self.__getRadioButton(6, defaults.defSelectionMethods, self.__radioSelectionMethodValue, defaults.radioSelectionMethodName)
|
||||||
|
|
||||||
|
self.__radioCrossingOverMethodValue = IntVar()
|
||||||
|
self.__radioCrossingOverMethodValue.set(self.__defaults.runCrossingOverMethod)
|
||||||
|
self.__getRadioButton(8, defaults.defCrossingOverMethods, self.__radioCrossingOverMethodValue, defaults.radioCrossingOverMethodName)
|
||||||
|
|
||||||
|
self.__radioMutationMethodValue = IntVar()
|
||||||
|
self.__radioMutationMethodValue.set(self.__defaults.runMutationMethod)
|
||||||
|
self.__getRadioButton(12, defaults.defMutationMethods, self.__radioMutationMethodValue, defaults.radioMutationMethodName)
|
||||||
|
|
||||||
|
self.__buttonDefaults = self.__getButton(15, 0, W, defaults.buttonDefaultsName, self.__setDefaults)
|
||||||
|
self.__buttonStart = self.__getButton(15, 1, E, defaults.buttonStartName, self.__getAllValues)
|
||||||
|
self.window.mainloop()
|
||||||
|
|
||||||
|
def __getSlider(self, rowNum, minVal, maxVal, runVal, labText):
|
||||||
|
label = Label(self.window, text = labText)
|
||||||
|
label.grid(row = rowNum, column = 0, sticky = S + W, padx = 5, pady = 5)
|
||||||
|
slider = Scale(self.window, variable = IntVar(), from_ = minVal, to = maxVal, orient=HORIZONTAL, length = 200)
|
||||||
|
slider.grid(row = rowNum, column = 1, sticky = E, padx = 5, pady = 3)
|
||||||
|
slider.set(runVal)
|
||||||
|
return slider
|
||||||
|
|
||||||
|
def __getButton(self, rowNum, colNum, stickPos, btnText, action):
|
||||||
|
button = Button(self.window, text = btnText, command = action)
|
||||||
|
button.grid(row = rowNum, column = colNum, stick = stickPos, columnspan = 2, padx=60, pady=5)
|
||||||
|
return button
|
||||||
|
|
||||||
|
def __getRadioButton(self, rowNum, methods, variable, labText):
|
||||||
|
label = LabelFrame(self.window, text = labText)
|
||||||
|
label.grid(row=rowNum, column=0, columnspan=2, padx=5, pady=5, sticky=W)
|
||||||
|
rowNum += 1
|
||||||
|
iteration = 0
|
||||||
|
for text, mode in methods:
|
||||||
|
radio = Radiobutton(label, text = text, variable = variable, value = mode)
|
||||||
|
radio.grid(row = rowNum, column = iteration % 2, sticky = W, padx = 5, pady = 3)
|
||||||
|
rowNum += iteration % 2
|
||||||
|
iteration += 1
|
||||||
|
|
||||||
|
def __setDefaults(self):
|
||||||
|
self.__sliderTablesCount.set(self.__defaults.defTablesCount)
|
||||||
|
self.__sliderPopulationSize.set(self.__defaults.defPopulationSize)
|
||||||
|
self.__sliderMutation.set(self.__defaults.defMutation)
|
||||||
|
self.__sliderGenerationsNumber.set(self.__defaults.defGenerationsNumber)
|
||||||
|
self.__sliderInfoFold.set(self.__defaults.defInfoFold)
|
||||||
|
self.__sliderElitism.set(self.__defaults.defElitism)
|
||||||
|
self.__radioSelectionMethodValue.set(self.__defaults.defSelectionMethod)
|
||||||
|
self.__radioCrossingOverMethodValue.set(self.__defaults.defCrossingOverMethod)
|
||||||
|
self.__radioMutationMethodValue.set(self.__defaults.defMutationMethod)
|
||||||
|
|
||||||
|
def __getAllValues(self):
|
||||||
|
self.__defaults.runTablesCount = self.__sliderTablesCount.get()
|
||||||
|
self.__defaults.runPopulationSize = self.__sliderPopulationSize.get()
|
||||||
|
self.__defaults.runMutation = self.__sliderMutation.get()
|
||||||
|
self.__defaults.runGenerationsNumber = self.__sliderGenerationsNumber.get()
|
||||||
|
self.__defaults.runInfoFold = self.__sliderInfoFold.get()
|
||||||
|
self.__defaults.runElitism = self.__sliderElitism.get()
|
||||||
|
self.__defaults.runSelectionMethod = self.__radioSelectionMethodValue.get()
|
||||||
|
self.__defaults.runCrossingOverMethod = self.__radioCrossingOverMethodValue.get()
|
||||||
|
self.__defaults.runMutationMethod = self.__radioMutationMethodValue.get()
|
||||||
|
self.window.destroy()
|
22
kelner/gui/chart/Plots.py
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
|
||||||
|
class Plots:
|
||||||
|
|
||||||
|
def __init__(self, generationNumber, bestFitnesses, bestTabless, worstFitnesses, worstTables, title):
|
||||||
|
self.__generationsNumber = generationNumber
|
||||||
|
self.__bestFitnesses = bestFitnesses
|
||||||
|
self.__bestTables = bestTabless
|
||||||
|
self.__worstTables = worstTables
|
||||||
|
self.__worstFitnesses = worstFitnesses
|
||||||
|
self.__title = title
|
||||||
|
|
||||||
|
def draw(self):
|
||||||
|
generations = [i for i in range(self.__generationsNumber + 1)]
|
||||||
|
plt.figure(num = self.__title)
|
||||||
|
plt.plot(generations, self.__bestTables, label = "stoliki najlepszego")
|
||||||
|
plt.plot(generations, self.__bestFitnesses, label="fitness najlepszego")
|
||||||
|
plt.plot(generations, self.__worstTables, label = "stoliki najgorszego")
|
||||||
|
plt.plot(generations, self.__worstFitnesses, label = "fitness najgorszego")
|
||||||
|
plt.legend()
|
||||||
|
plt.show()
|
Before Width: | Height: | Size: 184 B |
BIN
kelner/images/dataset/ffries/10500.jpg
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
kelner/images/dataset/ffries/17394.jpg
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
kelner/images/dataset/ffries/20215.jpg
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
kelner/images/dataset/ffries/24479.jpg
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
kelner/images/dataset/ffries/43636.jpg
Normal file
After Width: | Height: | Size: 75 KiB |
BIN
kelner/images/dataset/ffries/48052.jpg
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
kelner/images/dataset/ffries/51368.jpg
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
kelner/images/dataset/ffries/51678.jpg
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
kelner/images/dataset/ffries/52510.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
kelner/images/dataset/ffries/57594.jpg
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
kelner/images/dataset/macarons/1075.jpg
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
kelner/images/dataset/macarons/15110.jpg
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
kelner/images/dataset/macarons/15274.jpg
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
kelner/images/dataset/macarons/17515.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
kelner/images/dataset/macarons/28826.jpg
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
kelner/images/dataset/macarons/30074.jpg
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
kelner/images/dataset/macarons/305.jpg
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
kelner/images/dataset/macarons/50327.jpg
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
kelner/images/dataset/macarons/67737.jpg
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
kelner/images/dataset/macarons/70102.jpg
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
kelner/images/dataset/peas/11883.jpg
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
kelner/images/dataset/peas/17431.jpg
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
kelner/images/dataset/peas/17923.jpg
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
kelner/images/dataset/peas/17928.jpg
Normal file
After Width: | Height: | Size: 53 KiB |
BIN
kelner/images/dataset/peas/19123.jpg
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
kelner/images/dataset/peas/20934.jpg
Normal file
After Width: | Height: | Size: 71 KiB |
BIN
kelner/images/dataset/peas/42964.jpg
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
kelner/images/dataset/peas/4321.jpg
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
kelner/images/dataset/peas/5531.jpg
Normal file
After Width: | Height: | Size: 61 KiB |
BIN
kelner/images/dataset/peas/5615.jpg
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
kelner/images/dataset/pizza/11297.jpg
Normal file
After Width: | Height: | Size: 84 KiB |
BIN
kelner/images/dataset/pizza/2965.jpg
Normal file
After Width: | Height: | Size: 68 KiB |
BIN
kelner/images/dataset/pizza/34632.jpg
Normal file
After Width: | Height: | Size: 69 KiB |
BIN
kelner/images/dataset/pizza/40449.jpg
Normal file
After Width: | Height: | Size: 90 KiB |
BIN
kelner/images/dataset/pizza/53217.jpg
Normal file
After Width: | Height: | Size: 56 KiB |
BIN
kelner/images/dataset/pizza/54540.jpg
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
kelner/images/dataset/pizza/56449.jpg
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
kelner/images/dataset/pizza/5764.jpg
Normal file
After Width: | Height: | Size: 64 KiB |
BIN
kelner/images/dataset/pizza/59445.jpg
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
kelner/images/dataset/pizza/8917.jpg
Normal file
After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.6 KiB |
BIN
kelner/images/kelner_full_D.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
kelner/images/kelner_full_L.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
kelner/images/kelner_full_LD.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
kelner/images/kelner_full_LU.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
kelner/images/kelner_full_R.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
kelner/images/kelner_full_RD.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
kelner/images/kelner_full_RU.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
kelner/images/kelner_full_U.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
kelner/images/kitchen.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 850 B After Width: | Height: | Size: 820 B |
Before Width: | Height: | Size: 706 B After Width: | Height: | Size: 657 B |
Before Width: | Height: | Size: 155 KiB |
BIN
kelner/images/testDishes/apple_pie/0.jpg
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
kelner/images/testDishes/apple_pie/1.jpg
Normal file
After Width: | Height: | Size: 69 KiB |
BIN
kelner/images/testDishes/apple_pie/2.jpg
Normal file
After Width: | Height: | Size: 67 KiB |
BIN
kelner/images/testDishes/apple_pie/3.jpg
Normal file
After Width: | Height: | Size: 64 KiB |
BIN
kelner/images/testDishes/apple_pie/4.jpg
Normal file
After Width: | Height: | Size: 70 KiB |
BIN
kelner/images/testDishes/carrot_cake/0.jpg
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
kelner/images/testDishes/carrot_cake/1.jpg
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
kelner/images/testDishes/carrot_cake/2.jpg
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
kelner/images/testDishes/carrot_cake/3.jpg
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
kelner/images/testDishes/carrot_cake/4.jpg
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
kelner/images/testDishes/donuts/0.jpg
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
kelner/images/testDishes/donuts/1.jpg
Normal file
After Width: | Height: | Size: 66 KiB |
BIN
kelner/images/testDishes/donuts/2.jpg
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
kelner/images/testDishes/donuts/3.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
kelner/images/testDishes/donuts/4.jpg
Normal file
After Width: | Height: | Size: 66 KiB |
BIN
kelner/images/testDishes/hamburger/0.jpg
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
kelner/images/testDishes/hamburger/1.jpg
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
kelner/images/testDishes/hamburger/2.jpg
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
kelner/images/testDishes/hamburger/3.jpg
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
kelner/images/testDishes/hamburger/4.jpg
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
kelner/images/testDishes/hot_dog/0.jpg
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
kelner/images/testDishes/hot_dog/1.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
kelner/images/testDishes/hot_dog/2.jpg
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
kelner/images/testDishes/hot_dog/3.jpg
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
kelner/images/testDishes/hot_dog/4.jpg
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
kelner/images/testDishes/mussels/0.jpg
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
kelner/images/testDishes/mussels/1.jpg
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
kelner/images/testDishes/mussels/2.jpg
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
kelner/images/testDishes/mussels/3.jpg
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
kelner/images/testDishes/mussels/4.jpg
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
kelner/images/testDishes/nachos/0.jpg
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
kelner/images/testDishes/nachos/1.jpg
Normal file
After Width: | Height: | Size: 28 KiB |