Author: ruschein
Date: 2010-01-15 14:48:33 -0800 (Fri, 15 Jan 2010)
New Revision: 18939

Modified:
   
coreplugins/trunk/AutomaticLayout/src/csplugins/layout/algorithms/force/ForceDirectedLayout.java
   
coreplugins/trunk/AutomaticLayout/src/prefuse/util/force/BackwardEulerIntegrator.java
   coreplugins/trunk/AutomaticLayout/src/prefuse/util/force/EulerIntegrator.java
Log:
Removed Euler and Backward Euler integrator again.

Modified: 
coreplugins/trunk/AutomaticLayout/src/csplugins/layout/algorithms/force/ForceDirectedLayout.java
===================================================================
--- 
coreplugins/trunk/AutomaticLayout/src/csplugins/layout/algorithms/force/ForceDirectedLayout.java
    2010-01-15 22:43:48 UTC (rev 18938)
+++ 
coreplugins/trunk/AutomaticLayout/src/csplugins/layout/algorithms/force/ForceDirectedLayout.java
    2010-01-15 22:48:33 UTC (rev 18939)
@@ -285,9 +285,9 @@
                layoutProperties.add(new Tunable("numIterations", "Number of 
Iterations",
                                                 Tunable.INTEGER, new 
Integer(numIterations)));
 
-               layoutProperties.add(new Tunable("integrator", "Integration 
algorithm to use",
-                                                Tunable.LIST, new Integer(0), 
-                                                (Object) integratorArray, 
(Object) null, 0));
+//             layoutProperties.add(new Tunable("integrator", "Integration 
algorithm to use",
+//                                              Tunable.LIST, new Integer(0), 
+//                                              (Object) integratorArray, 
(Object) null, 0));
 
                // We've now set all of our tunables, so we can read the 
property 
                // file now and adjust as appropriate
@@ -347,6 +347,10 @@
                                layoutProperties.setProperty(t.getName(), 
t.getValue().toString());
                }
 
+
+
+               integrator = new RungeKuttaIntegrator();
+               /*
                t = layoutProperties.get("integrator");
                if ((t != null) && (t.valueChanged() || force)) {
                        if (t.valueChanged())
@@ -361,7 +365,10 @@
                                return;
                        m_fsim.setIntegrator(integrator);
                }
+               */
 
+
+
                edgeWeighter.updateSettings(layoutProperties, force);
        }
 

Modified: 
coreplugins/trunk/AutomaticLayout/src/prefuse/util/force/BackwardEulerIntegrator.java
===================================================================
--- 
coreplugins/trunk/AutomaticLayout/src/prefuse/util/force/BackwardEulerIntegrator.java
       2010-01-15 22:43:48 UTC (rev 18938)
+++ 
coreplugins/trunk/AutomaticLayout/src/prefuse/util/force/BackwardEulerIntegrator.java
       2010-01-15 22:48:33 UTC (rev 18939)
@@ -5,6 +5,10 @@
 
 import java.util.Iterator;
 
+//
+// ****************************************************   WARNING:  B R O K E 
N !!!
+//
+
 /**
  * Updates velocity and position data using the Backward Euler Method. This is 
the
  * simple and fast method, but is somewhat inaccurate and less smooth
@@ -22,7 +26,7 @@
        public void integrate(final ForceSimulator sim, final long timestep) {
                float speedLimit = sim.getSpeedLimit();
                Iterator iter = sim.getItems();
-               while (iter.hasNext()) {
+               while ( iter.hasNext() ) {
                        ForceItem item = (ForceItem)iter.next();
                        float coeff = timestep / item.mass;
                        item.velocity[0] += coeff * item.force[0];
@@ -31,7 +35,7 @@
                        item.location[1] += timestep * item.velocity[1];
                        float vx = item.velocity[0];
                        float vy = item.velocity[1];
-                       float v = (float)Math.sqrt(vx *vx + vy * vy);
+                       float v = (float)Math.sqrt(vx*vx + vy*vy);
                        if ( v > speedLimit ) {
                                item.velocity[0] = speedLimit * vx / v;
                                item.velocity[1] = speedLimit * vy / v;
@@ -39,4 +43,4 @@
                }
        }
 
-} // end of class EulerIntegrator
+} // end of class BackwardEulerIntegrator

Modified: 
coreplugins/trunk/AutomaticLayout/src/prefuse/util/force/EulerIntegrator.java
===================================================================
--- 
coreplugins/trunk/AutomaticLayout/src/prefuse/util/force/EulerIntegrator.java   
    2010-01-15 22:43:48 UTC (rev 18938)
+++ 
coreplugins/trunk/AutomaticLayout/src/prefuse/util/force/EulerIntegrator.java   
    2010-01-15 22:48:33 UTC (rev 18939)
@@ -12,27 +12,27 @@
  */
 public class EulerIntegrator implements Integrator {
     
-    /**
-     * @see 
prefuse.util.force.Integrator#integrate(prefuse.util.force.ForceSimulator, long)
-     */
-    public void integrate(ForceSimulator sim, long timestep) {
-        float speedLimit = sim.getSpeedLimit();
-        Iterator iter = sim.getItems();
-        while ( iter.hasNext() ) {
-            ForceItem item = (ForceItem)iter.next();
-            item.location[0] += timestep * item.velocity[0];
-            item.location[1] += timestep * item.velocity[1];
-            float coeff = timestep / item.mass;
-            item.velocity[0] += coeff * item.force[0];
-            item.velocity[1] += coeff * item.force[1];
-            float vx = item.velocity[0];
-            float vy = item.velocity[1];
-            float v = (float)Math.sqrt(vx*vx+vy*vy);
-            if ( v > speedLimit ) {
-                item.velocity[0] = speedLimit * vx / v;
-                item.velocity[1] = speedLimit * vy / v;
-            }
-        }
-    }
+       /**
+        * @see 
prefuse.util.force.Integrator#integrate(prefuse.util.force.ForceSimulator, long)
+        */
+       public void integrate(ForceSimulator sim, long timestep) {
+               float speedLimit = sim.getSpeedLimit();
+               Iterator iter = sim.getItems();
+               while ( iter.hasNext() ) {
+                       ForceItem item = (ForceItem)iter.next();
+                       item.location[0] += timestep * item.velocity[0];
+                       item.location[1] += timestep * item.velocity[1];
+                       float coeff = timestep / item.mass;
+                       item.velocity[0] += coeff * item.force[0];
+                       item.velocity[1] += coeff * item.force[1];
+                       float vx = item.velocity[0];
+                       float vy = item.velocity[1];
+                       float v = (float)Math.sqrt(vx*vx+vy*vy);
+                       if ( v > speedLimit ) {
+                               item.velocity[0] = speedLimit * vx / v;
+                               item.velocity[1] = speedLimit * vy / v;
+                       }
+               }
+       }
 
 } // end of class EulerIntegrator

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.


Reply via email to