From 4d13bed110194858e69e3d0a9dca8c67a4fa2dba Mon Sep 17 00:00:00 2001 From: Asecave Date: Sun, 22 Nov 2020 13:08:56 +0100 Subject: [PATCH] almost working --- MorseTree/Classification.ctxt | 4 +++- MorseTree/Decision.class | Bin 779 -> 874 bytes MorseTree/Decision.ctxt | 4 +++- MorseTree/Decision.java | 5 +++++ MorseTree/MorseTree.class | Bin 3709 -> 3738 bytes MorseTree/MorseTree.ctxt | 2 +- MorseTree/MorseTree.java | 9 +++++---- MorseTree/package.bluej | 25 ++++++++++++++----------- 8 files changed, 31 insertions(+), 18 deletions(-) diff --git a/MorseTree/Classification.ctxt b/MorseTree/Classification.ctxt index e9b47d4..a7a8901 100644 --- a/MorseTree/Classification.ctxt +++ b/MorseTree/Classification.ctxt @@ -4,4 +4,6 @@ comment0.text=\r\n\ Blattknoten\ eines\ Entscheidungsbaums.\ Klassifiziert\ eine comment1.params=pClassification comment1.target=Classification(java.lang.String) comment1.text=\r\n\ Erstellt\ eine\ Klassifikation\r\n\r\n\ @param\ pClassification\ Name\ der\ Klasse\ (z.B.\ "Ja"\ oder\ "Nein")\r\n -numComments=2 +comment2.params=pDataset +comment2.target=java.lang.String\ decide(Dataset) +numComments=3 diff --git a/MorseTree/Decision.class b/MorseTree/Decision.class index d8b0798766fcbec02cc082b69a7a73ecb1eb347e..6ebc79a8e9520b7f6058236122d638217c2881e6 100644 GIT binary patch delta 183 zcmXAiNe%%~7=*vSMR)6dW>$ta&pcLEHm=|hVnZSlhp_C6kVqsJ4&Var;1J?zo2suW zmDI_8+xq#rKY%$ij|4#im)cM29u1lvE!r*}m##z4p?}dSNxFyK>agEz*FvEeiWI|z z1f_w(!&fMLhoNG`*kPj3Ov9txBo=DxwJal~&7n3f#^Zx4*4cnX#;6^YeX@qte?X4B JNkS!BRlm;s6`lY9 delta 104 zcmaFG*3G7W>ff$?3=9nB4EkIQoD8y@3>*w{AVQvtL4iS$i$RG&nS()vgF%&@L5-b3 zeWN}faLCo2VdhGVQA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r^FqRGu3~d|QvRQ)E zVBvavYT+|{Zs7}jY2hR{!`N)$D|~I?8=SImC${PM*1~rcV^?>YJhoRT2#Ox9XB ziys}YazTnY<4Q_3aSlH@Z>n3JKDFENYJY1#^Jo0-c=XxQA5OD=Ncz(`uaC8NL8ejx z{>Txy(qoVhL5W1(hGMIEXa{JCd6+LFE*42>0qqDp>Ef&$x2-Wu%A+h2&?r!g2DCiNb68Z$ z4k(56#w(@|{GZRE#TQg$RVg>IgZH2m_K-w5jib;}Poo&B(SQi%pb3pwj=6O7aXO+V z3}GIXyBT}XLg(I!eH6PN31{5hT(<_P!meM%25h9-(1pOQG?M9!dnt1xt+mPNH)|qm zu#O^cqZKQmT!O75M1RsnbhiBi6>Dk2h1)4)*m>Oy`n{KH&9@F%2se_>3DcLMn?P~{ z*%?}g&!IP(hy5P(tZU)`4J+Tpv`8qA$p_)%nLPYimlWX{QZMyYSB$9Qh|4uf&`AS} zX?d1U*S^J7C#U-;bwXfeJZwy zlJ#OM25BRkNQ+m8=SoFVA$!7MQIj4nJChj#6p^#t2|_LMvVIe2J`c94d&!Q8}Y z{&2Z)xIt(%UP~Xoj<(Q`0R2<(>tV1e$=W8Kx8H0_rj>7KtHb2E$B( zic-=nmf0+&tO!e#rIc0A5@T_T_cXA~VKId?vdm@i2#KfC8O3g5vINcJpk|gyLRwf_ zS;~aWXIa2fE+oNn4NHZPHkO4fULi@AYgud|i%2r|Vx~$#OE{>VWwMZ^EFCO9A)PGC zSo}h|SeCO?30c9il4XjJRV>{s0UWi<03S*FlF^dB*yKb`;p diff --git a/MorseTree/MorseTree.ctxt b/MorseTree/MorseTree.ctxt index 9c3e135..ca15dcf 100644 --- a/MorseTree/MorseTree.ctxt +++ b/MorseTree/MorseTree.ctxt @@ -2,7 +2,7 @@ comment0.target=MorseTree comment1.params= comment1.target=void\ MorseTree() -comment2.params=tree\ morse +comment2.params=root\ morse comment2.target=void\ generateTree(BinaryTree,\ java.lang.String) comment3.params= comment3.target=void\ printHirarchical() diff --git a/MorseTree/MorseTree.java b/MorseTree/MorseTree.java index ca9b5e2..40ff5b1 100644 --- a/MorseTree/MorseTree.java +++ b/MorseTree/MorseTree.java @@ -35,11 +35,12 @@ public class MorseTree { public void MorseTree() { tree = new BinaryTree<>(); + tree.setContent(new Decision("", ".")); generateTree(tree, ""); } - public void generateTree(BinaryTree tree, String morse) { + public void generateTree(BinaryTree root, String morse) { String leftMorse = morse + "."; String rightMorse = morse + "-"; for (int i = 0; i < chars.length; i++) { @@ -47,12 +48,12 @@ public class MorseTree { BinaryTree leftTree = new BinaryTree<>(); leftTree.setContent(new Decision(chars[i][0], ".")); generateTree(leftTree, leftMorse); - tree.setLeftTree(leftTree); + root.setLeftTree(leftTree); } else if (chars[i][1].equals(rightMorse)) { BinaryTree rightTree = new BinaryTree<>(); - rightTree.setContent(new Decision(chars[i][0], ".")); + rightTree.setContent(new Decision(chars[i][0], "-")); generateTree(rightTree, rightMorse); - tree.setRightTree(rightTree); + root.setRightTree(rightTree); } } } diff --git a/MorseTree/package.bluej b/MorseTree/package.bluej index ac841e5..42efd82 100644 --- a/MorseTree/package.bluej +++ b/MorseTree/package.bluej @@ -1,5 +1,5 @@ #BlueJ package file -dependency1.from=Decision +dependency1.from=Classification dependency1.to=Dataset dependency1.type=UsesDependency dependency2.from=DecisionNode @@ -14,21 +14,24 @@ dependency4.type=UsesDependency dependency5.from=MorseTree dependency5.to=Decision dependency5.type=UsesDependency -editor.fx.0.height=1000 -editor.fx.0.width=1296 +dependency6.from=Decision +dependency6.to=Dataset +dependency6.type=UsesDependency +editor.fx.0.height=1026 +editor.fx.0.width=1696 editor.fx.0.x=-8 editor.fx.0.y=-8 -objectbench.height=93 -objectbench.width=1256 +objectbench.height=134 +objectbench.width=1656 package.divider.horizontal=0.6 -package.divider.vertical=0.8890122086570478 -package.editor.height=794 -package.editor.width=1145 +package.divider.vertical=0.847732181425486 +package.editor.height=778 +package.editor.width=1545 package.editor.x=0 package.editor.y=0 -package.frame.height=1000 -package.frame.width=1296 -package.numDependencies=5 +package.frame.height=1026 +package.frame.width=1696 +package.numDependencies=6 package.numTargets=6 package.showExtends=true package.showUses=true