Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement suggestion #5

Open
sguysc opened this issue Nov 2, 2021 · 0 comments
Open

Improvement suggestion #5

sguysc opened this issue Nov 2, 2021 · 0 comments

Comments

@sguysc
Copy link

sguysc commented Nov 2, 2021

In sampling/active_intersections.py, for the function _index_active:
Is there any reason you use

idx[:] = self.lincon.integration_domain(self.ellipse.x(t + dt)) - \
                 self.lincon.integration_domain(self.ellipse.x(t - dt))

To calculate the rising and falling edges where the segments become active, rather than
something like this:

active = self.lincon.integration_domain(self.ellipse.x(t + dt))
# make it cyclic
active = np.insert(active, 0, active[-1])
idx = active[1:]-active[0:-1]

Because the integration_domain function could be quite computationally expensive
if the problem has many dimensions and it should be called as little as possible.
More explanation: since we assume linear constrained domain, if
are two adjacent intersections, then sign(ellipse.x(+dt)) = sign(ellipse.x(-dt)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant