Wersja reprezentacyjna

This commit is contained in:
tomasz 2020-06-08 21:22:27 +02:00
parent de5f440b04
commit 55d3a56637
16 changed files with 210 additions and 197 deletions

View File

@ -3,6 +3,10 @@
<component name="ChangeListManager">
<list default="true" id="8264ee8d-5217-4cb6-b982-78f67fabc82e" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/funkcje.py" beforeDir="false" afterPath="$PROJECT_DIR$/funkcje.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/genetyczne.py" beforeDir="false" afterPath="$PROJECT_DIR$/genetyczne.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/program.py" beforeDir="false" afterPath="$PROJECT_DIR$/program.py" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
@ -16,21 +20,12 @@
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/whereDecision.py">
<entry file="file://$PROJECT_DIR$/funkcje.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="17">
<caret line="1" column="15" selection-start-line="1" selection-start-column="7" selection-end-line="1" selection-end-column="15" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/wheel.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="986">
<caret line="58" column="55" selection-start-line="58" selection-start-column="55" selection-end-line="58" selection-end-column="55" />
<state relative-caret-position="326">
<caret line="180" column="13" lean-forward="true" selection-start-line="180" selection-start-column="13" selection-end-line="180" selection-end-column="13" />
<folding>
<element signature="e#0#13#0" expanded="true" />
<element signature="e#0#43#0" expanded="true" />
</folding>
</state>
</provider>
@ -42,15 +37,19 @@
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Evencik.py">
<provider selected="true" editor-type-id="text-editor" />
<entry file="file://$PROJECT_DIR$/genetyczne.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="367">
<caret line="77" column="35" lean-forward="true" selection-start-line="77" selection-start-column="35" selection-end-line="77" selection-end-column="35" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/main.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="257">
<caret line="35" column="32" lean-forward="true" selection-start-line="35" selection-start-column="32" selection-end-line="35" selection-end-column="32" />
<state relative-caret-position="98">
<caret line="6" column="4" lean-forward="true" selection-start-line="6" selection-start-column="4" selection-end-line="6" selection-end-column="4" />
<folding>
<element signature="e#0#21#0" expanded="true" />
</folding>
@ -58,31 +57,10 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/program.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="255">
<caret line="15" selection-start-line="15" selection-end-line="15" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/neurons.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="272">
<caret line="16" selection-start-line="16" selection-end-line="16" />
<folding>
<element signature="e#0#12#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/AStar.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1377">
<state relative-caret-position="741">
<caret line="81" column="31" selection-start-line="81" selection-start-column="31" selection-end-line="81" selection-end-column="31" />
<folding>
<element signature="e#0#12#0" expanded="true" />
@ -92,10 +70,22 @@
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/generate.py">
<entry file="file://$PROJECT_DIR$/program.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3094">
<caret line="182" selection-start-line="182" selection-end-line="182" />
<state relative-caret-position="469">
<caret line="103" column="65" selection-start-line="103" selection-start-column="65" selection-end-line="103" selection-end-column="65" />
<folding>
<element signature="e#0#13#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Data.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="289">
<caret line="17" column="27" selection-start-line="17" selection-start-column="27" selection-end-line="17" selection-end-column="27" />
</state>
</provider>
</entry>
@ -111,8 +101,6 @@
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>tmp</find>
<find>global</find>
<find>cop</find>
<find>jakLiczycKoszt</find>
<find>jakLiczyc</find>
@ -141,6 +129,8 @@
<find>muta</find>
<find>mutate</find>
<find>od tego mom</find>
<find>regalsik</find>
<find>data</find>
</findStrings>
</component>
<component name="Git.Settings">
@ -166,7 +156,6 @@
<option value="$PROJECT_DIR$/genetyczny/randomBox.py" />
<option value="$PROJECT_DIR$/AStar.py" />
<option value="$PROJECT_DIR$/genetyczny/Gene1.py" />
<option value="$PROJECT_DIR$/main.py" />
<option value="$PROJECT_DIR$/genetyczny/genetyczny.py" />
<option value="$PROJECT_DIR$/Mapa/generate.py" />
<option value="$PROJECT_DIR$/genetyczny/Gene.py" />
@ -175,18 +164,19 @@
<option value="$PROJECT_DIR$/genetyczny/eee.py" />
<option value="$PROJECT_DIR$/genetyczny/genetyczne.py" />
<option value="$PROJECT_DIR$/opis/environment.md" />
<option value="$PROJECT_DIR$/program.py" />
<option value="$PROJECT_DIR$/funkcje.py" />
<option value="$PROJECT_DIR$/genetyczne.py" />
<option value="$PROJECT_DIR$/LechT.md" />
<option value="$PROJECT_DIR$/genetyczne.py" />
<option value="$PROJECT_DIR$/funkcje.py" />
<option value="$PROJECT_DIR$/program.py" />
<option value="$PROJECT_DIR$/main.py" />
</list>
</option>
</component>
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="643" />
<option name="x" value="2493" />
<option name="y" value="-8" />
<option name="width" value="758" />
<option name="height" value="1048" />
<option name="width" value="1078" />
<option name="height" value="838" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectReloadState">
@ -197,7 +187,17 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane" />
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="AI" type="b2602c69:ProjectViewProjectNode" />
<item name="AI" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope" />
</panes>
</component>
@ -226,7 +226,7 @@
</option>
</component>
<component name="RunManager" selected="Python.main">
<configuration name="AStar" type="PythonConfigurationType" factoryName="Python" temporary="true">
<configuration name="funkcje" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="AI" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
@ -238,7 +238,7 @@
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/AStar.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/funkcje.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
@ -247,7 +247,7 @@
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="generate" type="PythonConfigurationType" factoryName="Python" temporary="true">
<configuration name="genetyczne" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="AI" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
@ -259,7 +259,7 @@
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="C:\Users\zwyklak\Desktop\AI\generate.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/genetyczne.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
@ -334,10 +334,10 @@
<recent_temporary>
<list>
<item itemvalue="Python.main" />
<item itemvalue="Python.genetyczne" />
<item itemvalue="Python.funkcje" />
<item itemvalue="Python.neurons" />
<item itemvalue="Python.julian" />
<item itemvalue="Python.generate" />
<item itemvalue="Python.AStar" />
</list>
</recent_temporary>
</component>
@ -367,18 +367,18 @@
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="-7" y="-7" width="1550" height="838" extended-state="6" />
<frame x="1912" y="-8" width="1616" height="1176" extended-state="6" />
<editor active="true" />
<layout>
<window_info content_ui="combo" id="Project" order="0" sideWeight="0.4995206" visible="true" weight="0.20872483" />
<window_info content_ui="combo" id="Project" order="0" sideWeight="0.4995206" visible="true" weight="0.2114396" />
<window_info id="Structure" order="1" sideWeight="0.5004794" side_tool="true" weight="0.3382353" />
<window_info id="Favorites" order="2" sideWeight="0.5011338" side_tool="true" weight="0.27768165" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" weight="0.32640332" />
<window_info active="true" anchor="bottom" id="Run" order="2" sideWeight="0.49932885" visible="true" weight="0.21104816" />
<window_info anchor="bottom" id="Find" order="1" weight="0.32598275" />
<window_info active="true" anchor="bottom" id="Run" order="2" sideWeight="0.49932885" visible="true" weight="0.21093" />
<window_info anchor="bottom" id="Cvs" order="3" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="4" weight="0.4" />
<window_info anchor="bottom" x="1942" y="641" width="1156" height="277" id="Debug" order="5" sideWeight="0.49932885" weight="0.41302842" />
<window_info anchor="bottom" x="1942" y="641" width="1156" height="277" id="Debug" order="5" sideWeight="0.49932885" weight="0.4122723" />
<window_info anchor="bottom" id="TODO" order="6" weight="0.32848233" />
<window_info anchor="bottom" id="Version Control" order="7" weight="0.32848233" />
<window_info anchor="bottom" id="Terminal" order="8" weight="0.32848233" />
@ -414,13 +414,6 @@
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/genetyczne.py</url>
<line>94</line>
<option name="timeStamp" value="231" />
</line-breakpoint>
</breakpoints>
<default-breakpoints>
<breakpoint type="python-exception">
<properties notifyOnTerminate="true" exception="BaseException">
@ -470,16 +463,6 @@
<entry file="file://$PROJECT_DIR$/images/nip.png">
<provider selected="true" editor-type-id="images" />
</entry>
<entry file="file://$PROJECT_DIR$/wheel.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="986">
<caret line="58" column="55" selection-start-line="58" selection-start-column="55" selection-end-line="58" selection-end-column="55" />
<folding>
<element signature="e#0#13#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/floor.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="153">
@ -487,16 +470,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/neurons.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="272">
<caret line="16" selection-start-line="16" selection-end-line="16" />
<folding>
<element signature="e#0#12#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/AppData/Local/Programs/Python/Python37/Lib/site-packages/easygui/boxes/fileopen_box.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="459">
@ -504,13 +477,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/whereDecision.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="17">
<caret line="1" column="15" selection-start-line="1" selection-start-column="7" selection-end-line="1" selection-end-column="15" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/AppData/Local/Programs/Python/Python37/Lib/random.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="366">
@ -518,16 +484,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Evencik.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/generate.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3094">
<caret line="182" selection-start-line="182" selection-end-line="182" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/wall.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="187">
@ -566,16 +522,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Data.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="289">
<caret line="17" column="27" selection-start-line="17" selection-start-column="27" selection-end-line="17" selection-end-column="27" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/shelf.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/route-planning.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
@ -622,33 +568,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/main.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="257">
<caret line="35" column="32" lean-forward="true" selection-start-line="35" selection-start-column="32" selection-end-line="35" selection-end-column="32" />
<folding>
<element signature="e#0#21#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/AStar.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1377">
<caret line="81" column="31" selection-start-line="81" selection-start-column="31" selection-end-line="81" selection-end-column="31" />
<folding>
<element signature="e#0#12#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/program.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="255">
<caret line="15" selection-start-line="15" selection-end-line="15" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/KijowskiM.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
@ -659,17 +578,94 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/funkcje.py">
<entry file="file://$PROJECT_DIR$/generate.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3026">
<caret line="183" selection-start-line="183" selection-end-line="183" />
<state relative-caret-position="3094">
<caret line="182" selection-start-line="182" selection-end-line="182" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/neurons.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="221">
<caret line="16" selection-start-line="16" selection-end-line="16" />
<folding>
<element signature="e#0#12#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Evencik.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/whereDecision.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="17">
<caret line="1" column="15" selection-start-line="1" selection-start-column="7" selection-end-line="1" selection-end-column="15" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/AStar.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="741">
<caret line="81" column="31" selection-start-line="81" selection-start-column="31" selection-end-line="81" selection-end-column="31" />
<folding>
<element signature="e#0#12#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Data.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="289">
<caret line="17" column="27" selection-start-line="17" selection-start-column="27" selection-end-line="17" selection-end-column="27" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/shelf.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/wheel.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="684">
<caret line="58" column="55" selection-start-line="58" selection-start-column="55" selection-end-line="58" selection-end-column="55" />
<folding>
<element signature="e#0#13#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/program.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="469">
<caret line="103" column="65" selection-start-line="103" selection-start-column="65" selection-end-line="103" selection-end-column="65" />
<folding>
<element signature="e#0#13#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/genetyczne.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="169">
<caret line="32" column="13" selection-start-line="32" selection-start-column="13" selection-end-line="32" selection-end-column="13" />
<state relative-caret-position="367">
<caret line="77" column="35" lean-forward="true" selection-start-line="77" selection-start-column="35" selection-end-line="77" selection-end-column="35" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/funkcje.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="326">
<caret line="180" column="13" lean-forward="true" selection-start-line="180" selection-start-column="13" selection-end-line="180" selection-end-column="13" />
<folding>
<element signature="e#0#43#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/main.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="98">
<caret line="6" column="4" lean-forward="true" selection-start-line="6" selection-start-column="4" selection-end-line="6" selection-end-column="4" />
<folding>
<element signature="e#0#21#0" expanded="true" />
</folding>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -187,38 +187,46 @@ def updateMap(data, map, mapForAstar, regals):
def okno():
try:
good = True
fieldValues = multenterbox("Wprowadź warunki początkowe", "Start algorytmu genetycznego", ["Ile chrom. w generacji", "Wielkosc dziedziczonego fragmentu (x>0 and x<1)", "Wartosc mutacji (x>0 and x<1)", "Unbox: (0or 1 or 2 or 2)", "Ile generacji"])
if(fieldValues[0].isnumeric() and (fieldValues[0]!="")):
fieldValues = multenterbox("Wprowadź warunki początkowe", "Start algorytmu genetycznego", ["Ile chrom. w generacji", "Wielkosc dziedziczonego fragmentu (x>0 and x<1)", "Wartosc mutacji (x>0 and x<1)", "Gdzie odwieść paczkę: (0 or 1 or 2 or 3)", "Ile generacji"])
if(fieldValues[0] == None):
return 0
if(not(fieldValues[0].isnumeric() and (fieldValues[0]!=""))):
good = False
elif(good==True):
msgbox("Wartość nie jest liczbą", "Błąd")
good = False
if(fieldValues[1].isnumeric() and (fieldValues[1]!="")):
if((int(fieldValues[1])<=0) and (good==True) and (int(fieldValues[1])>= 1)):
if(isinstance(float(fieldValues[1]),float) and (fieldValues[1]!="")):
if((float(fieldValues[1])<=0) and (good==True) and (float(fieldValues[1])>= 1)):
msgbox("Zla wartosc fragmentu")
good = False
elif (good == True):
msgbox("Wartość nie jest liczbą", "Błąd")
good = False
if(fieldValues[2].isnumeric() and (fieldValues[2]!="")):
if((int(fieldValues[1])<=0) and (good==True) and (int(fieldValues[1])>= 1)):
if(isinstance(float(fieldValues[2]),float) and (fieldValues[2]!="")):
if((float(fieldValues[1])<=0) and (good==True) and (float(fieldValues[1])>= 1)):
msgbox("Zla wartosc mutacji")
good = False
elif (good == True):
msgbox("Wartość nie jest liczbą", "Błąd")
good = False
if(fieldValues[3].isnumeric() and (fieldValues[3]!="")):
if(((int(fieldValues[3]) != 0) or (int(fieldValues[3]) != 1) or (int(fieldValues[3]) != 2) or (int(fieldValues[3]) != 3)) and (good==True)):
if(((int(fieldValues[3]) != 0) and (int(fieldValues[3]) != 1) and (int(fieldValues[3]) != 2) and (int(fieldValues[3]) != 3))):
msgbox("Zla wartosc unboxa")
good = False
elif (good == True):
msgbox("Wartość nie jest liczbą", "Błąd")
good = False
if(fieldValues[4].isnumeric() and (fieldValues[4]!="")):
pass
else:
if(not(fieldValues[4].isnumeric() and (fieldValues[4]!=""))):
msgbox("Wartość nie jest liczbą", "Błąd")
good = False
if(good == True):
return [fieldValues[0], fieldValues[1], fieldValues[2],fieldValues[3]]
return [fieldValues[0], fieldValues[1], fieldValues[2],fieldValues[3], fieldValues[4]]
except:
return 0

View File

@ -1,13 +1,13 @@
from funkcje import *
from Gene import Gene
def start(data, wheel):
def start(data, wheel, dane):
ileGeneracji = 20
ileWPopulacji = 16
fragment = 0.5
mutacja = 0.05
unbox = 3
ileGeneracji = int(dane[4])
ileWPopulacji = int(dane[0])
fragment = float(dane[1])
mutacja = float(dane[2])
unbox = int(dane[3])
data.kordyWozka = (wheel.ns, wheel.we)
data.jakLiczycKoszt = unbox

11
main.py
View File

@ -3,10 +3,11 @@ from program import MainWindow
import os;
def main():
good = False
while (True):
good = True
"""
fieldValues = multenterbox("Wprowadź warunki początkowe", "Start programu", ["Szerekość kraty (>=6)", "Wysokość kraty (>=7)", "Ilość regałów kruchych", "Ilość regałów łatwopalnych", "Ilość regałów radioaktywnych", "Ilość regałów niebezpiecznych"])
if(fieldValues[0].isnumeric() and (fieldValues[0]!="")):
if(int(fieldValues[0])<=5):
@ -31,8 +32,11 @@ def main():
elif (good == True):
msgbox("Wartość nie jest liczbą", "Błąd")
good = False
"""
if good:
window = MainWindow(int(fieldValues[0]), int(fieldValues[1]), int(fieldValues[2]), int(fieldValues[3]), int(fieldValues[4]), int(fieldValues[5]));
break
"""
szerokosc = 15#min 6
wysokosc = 10 #min 7
kruche = 1
@ -40,5 +44,6 @@ def main():
radioaktywne = 1
niebezpieczne= 1
window = MainWindow(szerokosc, wysokosc, kruche, latwopalne, radioaktywne, niebezpieczne);
break
"""
main()

View File

@ -88,7 +88,11 @@ class MainWindow:
elif(event.type==pygame.KEYDOWN):
if event.key == pygame.K_g:
start(self.data,self.wheel)
updateMap(self.data, self.map, self.mapForAStar, self.regals)
dane = okno()
if(dane == 0):
continue
start(self.data,self.wheel, dane)
for gen in self.data.best[0]:
if(gen.unboxWczesniejszegoGenu == None):
kordStartowy = (self.wheel.ns, self.wheel.we)
@ -97,7 +101,7 @@ class MainWindow:
zbierzBox(gen,self.data, self.moves, kordStartowy)
elif(event.key== pygame.K_r):
self.map = randomBox(self.map, self.regals, 15)
self.map = randomBox(self.map, self.regals, 5)
updateMap(self.data, self.map, self.mapForAStar, self.regals)
elif len(self.moves)==0:
self.wheel.move(event, self.map)