Re:You might not need machine learning
by organian on Tuesday November 24, 2020 @06:05AM
(#25197355)
The arrow operator is a field access through a pointer. That is, if you have a pointer to a struct, it's the same as dereferencing the pointer and accessing the field: "(*foo).bar" corresponds to "foo->bar".
I think the main driving logic is on line 228. It could definitely do with some more descriptive variable names, though - "a" for angle, and "s" for sense inputs seems a bit too short.
-> is a dereference operator.
On line 65 (function ppm_create), f is declared as a pointer to a structure of type ppm (a reference to an object of type ppm).
f is the actual structure/object.
(f).w is the 'w' member of the structure. The brackets are needed for operator priority.
f->w is another way to write (*f).w
https://gist.github.com/skeeto/da7b2ac95730aa767c8faf8ec3098...
The concepts and equations he has are pretty simple but I'm really not seeing how they translate into code.
The code also isn't the easiest to try and understand for me. Multiple 1-3 letter or otherwise (Seemingly) poorly named variables, some C jargon I'm not familiar with (Mostly the -> operator) and the fact it's a relatively large chunk of code.
It seems like the core logic loop is here: https://gist.github.com/skeeto/da7b2ac95730aa767c8faf8ec3098...
And the position and acceleration of the car is altered each iteration through randomization?
It's hard to piece together.