Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Getting configuration info from Kinetic Data Structure

Subject: CGAL users discussion list

List archive

[cgal-discuss] Getting configuration info from Kinetic Data Structure


Chronological Thread 
  • From: dharmon <>
  • To:
  • Subject: [cgal-discuss] Getting configuration info from Kinetic Data Structure
  • Date: Fri, 6 Jan 2012 13:24:53 -0800 (PST)

Hello,

I want to run a simulation, on the 1D Sort Kinetic Data Structure (KDS), for
example, by reading data from a file where each line is id,t,v triplets,
where id is a point index, t is a time, and v is a new velocity.
(I am assuming piecewise linear trajectories and constant number of points.)

so I can do something like

// read a line (id,t,v) from file
do
{
sh.set_current_time(t); // tell simulation handle to update time
*tr.active_points_1_table_handle().set(key(id), v) // Should send a "set"
notification to the KDS

// read new line
} while (!in.eof());

Then what I want to do is essentially hijack the set method in the KDS. In
this method I want to look at the points, in particular their position and
velocity at the current simulation time, and do some stuff with it.

How do I do this last part? It seems simple but I can't figure it out.

The active objects table stores Point_1 as its data type (for this specific
KDS). If I call aot.at(k) I get a Point_1 back. How do I turn this into a
double that represents the approximation of the position (and velocity) of
point k at the current time?

I assume if I figure this out for Point_1 it will be straight-forward to do
it for Point_2 and Point_3, as used by the other included KDS.

Thanks for your help.

--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Getting-configuration-info-from-Kinetic-Data-Structure-tp4270911p4270911.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.16.

Top of Page