KineticEvaluator takes the maximum time between the two simulators ar
authorDmitriy Morozov <morozov@cs.duke.edu>
Sun, 02 Mar 2008 16:42:33 -0500
branchar
changeset 84 c711bb2916e4
parent 83 cf653a5a2d4f
child 85 58deab1c8eb9
KineticEvaluator takes the maximum time between the two simulators
examples/ar-vineyard/ar-vineyard.h
examples/ar-vineyard/ar-vineyard.hpp
--- a/examples/ar-vineyard/ar-vineyard.h	Sun Mar 02 16:11:05 2008 -0500
+++ b/examples/ar-vineyard/ar-vineyard.h	Sun Mar 02 16:42:33 2008 -0500
@@ -197,14 +197,17 @@
 class ARVineyard::KineticEvaluator: public Evaluator
 {
 	public:
-									KineticEvaluator(Simulator* simulator): 
-                                        simulator_(simulator)                                   {}
+									KineticEvaluator(Simulator* simplex_sort_simulator,
+                                                     Simulator* trajectory_sort_simulator): 
+                                        simplex_sort_simulator_(simplex_sort_simulator),
+                                        trajectory_sort_simulator_(trajectory_sort_simulator)   {}
 
-		virtual RealType			time() const												{ return simulator_->current_time(); }
+		virtual RealType			time() const												{ return std::max(simplex_sort_simulator_->current_time(), trajectory_sort_simulator_->current_time()); }
 		virtual RealType			value(const Simplex& s)	const								{ return FunctionKernel::value_at(s.max_threshold(), time()); }
 
 	private:
-		Simulator*                  simulator_;
+		Simulator*                  simplex_sort_simulator_;
+        Simulator*                  trajectory_sort_simulator_;
 };
 
 
--- a/examples/ar-vineyard/ar-vineyard.hpp	Sun Mar 02 16:11:05 2008 -0500
+++ b/examples/ar-vineyard/ar-vineyard.hpp	Sun Mar 02 16:42:33 2008 -0500
@@ -112,7 +112,7 @@
     rLog(rlARVineyardComputing, "TrajectorySort size: %i", trajectory_sort_simulator.size());
 	
     // Simulate
-	change_evaluator(new KineticEvaluator(&simplex_sort_simulator));
+	change_evaluator(new KineticEvaluator(&simplex_sort_simulator, &trajectory_sort_simulator));
     while(!simplex_sort_simulator.reached_infinity() || !trajectory_sort_simulator.reached_infinity())
     {
         if (*(simplex_sort_simulator.top()) < *(trajectory_sort_simulator.top()))