1.1 --- a/src/java/isac/bridge/MathEngine.java Mon Sep 20 17:14:06 2004 +0200
1.2 +++ b/src/java/isac/bridge/MathEngine.java Mon Sep 20 17:14:06 2004 +0200
1.3 @@ -7,6 +7,7 @@
1.4 import isac.util.NotInSpecificationPhaseException;
1.5 import isac.util.formulae.CalcHead;
1.6 import isac.util.formulae.CalcHeadCompoundID;
1.7 +import isac.util.formulae.Position;
1.8 import isac.util.interfaces.ICalcElement;
1.9 import isac.util.interfaces.ICalcIterator;
1.10 import isac.util.tactics.Tactic;
1.11 @@ -18,6 +19,8 @@
1.12 import java.util.Map;
1.13 import java.util.Vector;
1.14
1.15 +import org.apache.log4j.Logger;
1.16 +
1.17 /**
1.18 * Class MathEngine: This class is called by the Dialog
1.19 * and communicates with the Bridge via RMI.
1.20 @@ -35,8 +38,11 @@
1.21 // and hands them out to the dialog after startSolving//WN00827 ???
1.22 private Map calcTrees;
1.23
1.24 + static Logger logger = Logger.getLogger(MathEngine.class.getName());
1.25 +
1.26 // This is a Singleton Class: A private constructor is needed
1.27 private MathEngine(String hostName) {
1.28 + logger.warn("MathEngine obj.init: hostName="+hostName);
1.29 try {
1.30 //connect to bridge
1.31 bridgeRMI = (IBridgeRMI) Naming.lookup("//" + hostName + "/BridgeRMI");
1.32 @@ -64,6 +70,7 @@
1.33 }
1.34
1.35 public static MathEngine getMathEngine() {
1.36 + logger.warn("getMathEngine");
1.37 return singleton;
1.38 }
1.39
1.40 @@ -74,6 +81,7 @@
1.41 * @throws RemoteException
1.42 */
1.43 public CalcHead startCalculation(Formalization f) {
1.44 + logger.warn("startCalculation: formalization="+f);
1.45 CalcHead calcHead = null;
1.46 try {
1.47 int id = bridgeRMI.startCalculation(f);
1.48 @@ -100,6 +108,7 @@
1.49 * @return CalcTree represents the calculation on the java side
1.50 */
1.51 public CalcTree startSolving(CalcHead calcHead) throws Exception {
1.52 + logger.warn("startSolving: calcHead="+calcHead);
1.53 int id = calcHead.getCalcTreeID();
1.54 CalcTree calcTree = (CalcTree) calcTrees.get(new Integer(id));
1.55
1.56 @@ -123,6 +132,7 @@
1.57 * @return new CalcHead with a status for each item
1.58 */
1.59 public void modifyCalcHead(CalcHead calcHead) {
1.60 + logger.warn("modifyCalcHead: calcHead="+calcHead);
1.61 CalcHead newCalcHead = null;
1.62 try {
1.63 newCalcHead = bridgeRMI.modifyCalcHead(calcHead);
1.64 @@ -138,6 +148,7 @@
1.65 * @param calcHead the calcHead to be completed
1.66 */
1.67 public void completeCalcHead(CalcHead calcHead) {
1.68 + logger.warn("completeCalcHead: calcHead="+calcHead);
1.69 CalcHead newCalcHead = null;
1.70 try {
1.71 newCalcHead = bridgeRMI.completeCalcHead(calcHead);
1.72 @@ -231,15 +242,18 @@
1.73 }
1.74
1.75 boolean autoCalculate(int id, int scope, int nSteps) throws RemoteException {
1.76 + logger.warn("autoCalculate: id="+id+", scope="+scope+", nSteps="+nSteps);
1.77 return bridgeRMI.autoCalculate(id, scope, nSteps);
1.78 }
1.79
1.80 int iterator(int id) throws RemoteException {
1.81 + logger.warn("iterator: id="+id);
1.82 return bridgeRMI.iterator(id);
1.83 }
1.84
1.85 boolean moveRoot(int calcTreeID, int iteratorID) throws RemoteException {
1.86 - return bridgeRMI.moveRoot(calcTreeID, iteratorID);
1.87 + logger.warn("moveRoot: calcTreeID="+calcTreeID+", iteratorID="+iteratorID);
1.88 + return bridgeRMI.moveRoot(calcTreeID, iteratorID);
1.89 }
1.90
1.91 boolean moveUp(int calcTreeID, int iteratorID) throws RemoteException {
1.92 @@ -247,6 +261,7 @@
1.93 }
1.94
1.95 boolean moveDown(int calcTreeID, int iteratorID) throws RemoteException {
1.96 + logger.warn("moveDown: calcTreeID="+calcTreeID+", iteratorID="+iteratorID);
1.97 return bridgeRMI.moveDown(calcTreeID, iteratorID);
1.98 }
1.99