diff --git a/GroupProjectRASQL/Heuristics/Heuristic.cs b/GroupProjectRASQL/Heuristics/Heuristic.cs index a745b5e..2ed87d4 100644 --- a/GroupProjectRASQL/Heuristics/Heuristic.cs +++ b/GroupProjectRASQL/Heuristics/Heuristic.cs @@ -13,8 +13,8 @@ public abstract class Heuristic : Reactive { protected Node root; protected Node next; - protected bool isStarted = false; - public bool isComplete { get { return isStarted && remainingNodes.Count == 0; } } + public bool isStarted { get; private set; } = false; + public bool isComplete { get; private set; } = false; public bool isEnabled { get; set; } = true; public String name { get; protected set; } public String description { get; protected set; } @@ -38,23 +38,25 @@ public void Init() // init the heuristic public void Step() // step through the currently active heuristic - called by ui button { + if (!isEnabled) return; if (!isStarted) Init(); - if (isComplete) return; + if (IsComplete()) return; Node next = remainingNodes.Dequeue(); if (next.IsRoot && next.IsLeaf) Step(); bool stop = Run(next); - if (!stop && !isComplete) Step(); + if (!stop && !IsComplete()) Step(); } - public void Complete() // complete the currently active heurisitc - called by ui button + private bool IsComplete() { - while (!isComplete) Step(); // while not done - step without interuptions + return isComplete = (isStarted && remainingNodes.Count == 0); } - public void Reset() + public void Complete() // complete the currently active heurisitc - called by ui button { - isStarted = false; + if (!isEnabled) return; + while (!IsComplete()) Step(); // while not done - step without interuptions } // Abstract method run for each Node in the tree. diff --git a/GroupProjectRASQL/View/src/components/components.vendor.js b/GroupProjectRASQL/View/src/components/components.vendor.js index ee39832..35a128f 100644 --- a/GroupProjectRASQL/View/src/components/components.vendor.js +++ b/GroupProjectRASQL/View/src/components/components.vendor.js @@ -1,2 +1,5 @@ import VueCodemirror from 'vue-codemirror' -Vue.use(VueCodemirror); \ No newline at end of file +Vue.use(VueCodemirror); + +import FontAwesomeIcon from '@fortawesome/vue-fontawesome' +Vue.component('font-awesome-icon', FontAwesomeIcon); \ No newline at end of file diff --git a/GroupProjectRASQL/View/src/components/views/output.vue b/GroupProjectRASQL/View/src/components/views/output.vue index 1fe695a..592c002 100644 --- a/GroupProjectRASQL/View/src/components/views/output.vue +++ b/GroupProjectRASQL/View/src/components/views/output.vue @@ -43,16 +43,17 @@
- + -
+
+
{{model.CurrentHeuristic.name}}
{{model.CurrentHeuristic.description}}
- +
@@ -67,8 +68,15 @@
-
-
{{heuristic}}
+ +
+
+
+ +
+
+ {{heuristic.name}} +