1.1 --- a/src/java/isac/bridge/BridgeLogger.java Fri Sep 12 09:26:49 2003 +0200
1.2 +++ b/src/java/isac/bridge/BridgeLogger.java Fri Sep 12 11:36:17 2003 +0200
1.3 @@ -4,6 +4,7 @@
1.4 package isac.bridge;
1.5
1.6 /**
1.7 + Simple Logging utility class used by the bridge components
1.8 * @author rgradisc
1.9 */
1.10
2.1 --- a/src/java/isac/bridge/CalcTree.java Fri Sep 12 09:26:49 2003 +0200
2.2 +++ b/src/java/isac/bridge/CalcTree.java Fri Sep 12 11:36:17 2003 +0200
2.3 @@ -5,45 +5,139 @@
2.4
2.5 import isac.util.Formula;
2.6 import isac.util.ModSpec;
2.7 +import isac.util.Tactic;
2.8
2.9 /**
2.10 + * A CalcTree represents a Calculation, it is a tree which consists
2.11 + * of one Model and abitrarily many Formulas and Tactics.
2.12 + * SubCalculations are also part of this
2.13 + * This is the main interface between the Bridge and the Dialog
2.14 * @author rgradisc
2.15 */
2.16 public class CalcTree {
2.17 -
2.18 - public CalcTree(ModSpec modSpec) {
2.19 -
2.20 - }
2.21 -
2.22 - public static int checkModSpec(ModSpec modSpec) {
2.23 - return 0;
2.24 - }
2.25 -
2.26 - public CalcIterator iterator() {
2.27 - return new CalcIterator(this);
2.28 - }
2.29 -
2.30 - public void moveActiveFormula(CalcIterator newActiveFormula) {
2.31 - }
2.32 -
2.33 - public int replaceFormula(Formula newFormula) {
2.34 - return 0;
2.35 - }
2.36 -
2.37 - public int appendFormula(Formula newFormula) {
2.38 - return 0;
2.39 - }
2.40 -
2.41 - public int setNextTactic(Tactic tactic) {
2.42 - }
2.43 -
2.44 - public Tactic fetchProposedTactic() {
2.45 - }
2.46 -
2.47 - public Tactic[] fetchAppliableTactics(int scope) {
2.48 - }
2.49 -
2.50 - public void autoCalculate(int scope, int nSteps) {
2.51 - }
2.52 -
2.53 +
2.54 + /**
2.55 + Start a new calculation. In case of failure,
2.56 + the constructor may change the formalization object to hint at incomplete or
2.57 + contradictory specifications.
2.58 + <p> Under normal circumstances, only complete Modspecs should be passed.
2.59 + <p> Check every ModSpec for completeness (with the
2.60 + static method checkModSpec() before constructing a CalcTree.
2.61 + * @param modSpec The ModSpec for this CalcTree
2.62 + */
2.63 + public CalcTree(ModSpec modSpec) {
2.64 + }
2.65 +
2.66 + /**
2.67 + This is a static method to check a ModSpec object for completeness
2.68 + and consistency.
2.69 + <p>This Method may change the passed ModSpec object to hint at
2.70 + incomplete or contradictory specifications.
2.71 + * @param modSpec The ModSpec to be changed
2.72 + * @return success value: 0 == success, else no success
2.73 + */
2.74 + public static int checkModSpec(ModSpec modSpec) {
2.75 + return 0;
2.76 + }
2.77 +
2.78 + /**
2.79 + Attach another dialog to the existing calculation tree.
2.80 + * @param dlg The new Dialog to be attatched to this CalcTree
2.81 + */
2.82 + public void attach(Dialog dlg) {
2.83 + }
2.84 +
2.85 + /**
2.86 + Get a new iterator referencing the root element of the calculation tree.
2.87 + <p> The functionality for navigating the calculation
2.88 + is implemented in the CalcIterator object.
2.89 + * @return a new instance of CalcIterator
2.90 + */
2.91 + public CalcIterator iterator() {
2.92 + return new CalcIterator(this);
2.93 + }
2.94 +
2.95 + /**
2.96 + Makes the passed formula the active formula, i.e. the formula
2.97 + the next tactic is applied to.
2.98 + * @param newActiveFormula
2.99 + */
2.100 + public void moveActiveFormula(CalcIterator newActiveFormula) {
2.101 + }
2.102 +
2.103 + /**
2.104 + Tries to replaces the active formula in the calculation tree by
2.105 + the passed formula. This could fail if no valid derivation from
2.106 + the preceding formula to the (new) active formula can be found.
2.107 + <p>Parts of the calculation after the replaced
2.108 + formula are likely to become invalid.
2.109 + * @param newFormula
2.110 + * @return The method will return 0 on success or a nonzero value
2.111 + indicating the status otherwise.
2.112 + */
2.113 + public int replaceFormula(Formula newFormula) {
2.114 + return 0;
2.115 + }
2.116 +
2.117 + /**
2.118 + Tries to append the passed formula after the active formula.
2.119 + This could fail if no valid derivation from the preceding formula
2.120 + to the (new) active formula can be found. The method will fail as
2.121 + well if the active formula is not the last formula in the (sub)calculation.
2.122 + Parts of the calculation might become invalid.
2.123 + * @param newFormula
2.124 + * @return The method will return 0 on success or a nonzero value
2.125 + indicating the status otherwise.
2.126 + */
2.127 + public int appendFormula(Formula newFormula) {
2.128 + return 0;
2.129 + }
2.130 +
2.131 + /**
2.132 + Set the tactic to be used in the next step of calculation.
2.133 + * @param tactic
2.134 + * @return The return value indicates success, failure or probable
2.135 + success at a later time.
2.136 + */
2.137 + public int setNextTactic(Tactic tactic) {
2.138 + return 0;
2.139 + }
2.140 +
2.141 + /**
2.142 + Get the tactic proposed by the mathematics engine for
2.143 + the next step in the calculation.
2.144 + * @return proposed tactic
2.145 + */
2.146 + public Tactic fetchProposedTactic() {
2.147 + return new Tactic();
2.148 + }
2.149 +
2.150 + /**
2.151 + Get a list of tactics applicable to the active formula.
2.152 + * @param scope The filter parameter selects the scope of
2.153 + search for applicable tactics: all tactics / all tactics from the
2.154 + current theory / all tactics from the (calculation) method being applied.
2.155 + * @return Array with applyable tactics
2.156 + */
2.157 + public Tactic[] fetchAppliableTactics(int scope) {
2.158 + return new Tactic[10];
2.159 + }
2.160 +
2.161 + /**
2.162 + Calculate the next n steps starting from the active formula.
2.163 + * @param scope The scope parameter can have following values:
2.164 + <ul>
2.165 + <li> 1 .. Stay in the current subproblem
2.166 + <li> 2 .. Stay in the current subcalculation (e.g. repetitions)
2.167 + <li> 3 .. Stay in the current calculation as a whole.
2.168 + </ul>
2.169 + * @param nSteps Specifies the count of steps to be autocalculated.
2.170 + Passing 0 for nSteps will calculate until reaching a final result.
2.171 + * @return The method returns an unique id to identify the request when
2.172 + notifying about updates in the tree.
2.173 + */
2.174 + public int autoCalculate(int scope, int nSteps) {
2.175 + return 0;
2.176 + }
2.177 +
2.178 }
3.1 --- a/src/java/isac/bridge/XMLParser.java Fri Sep 12 09:26:49 2003 +0200
3.2 +++ b/src/java/isac/bridge/XMLParser.java Fri Sep 12 11:36:17 2003 +0200
3.3 @@ -7,7 +7,6 @@
3.4 * @author rgradisc
3.5 */
3.6
3.7 -//tropmi xas.tnuoCXAS;
3.8 import java.io.IOException;
3.9 import java.io.StringReader;
3.10 import java.io.StringWriter;