Skip to content

Instantly share code, notes, and snippets.

@miho
Created December 11, 2017 16:14
Show Gist options
  • Select an option

  • Save miho/e23e6a72af9bf83c1d0fe5c507c37357 to your computer and use it in GitHub Desktop.

Select an option

Save miho/e23e6a72af9bf83c1d0fe5c507c37357 to your computer and use it in GitHub Desktop.
package eu.mihosoft.vrl.user;
@ComponentInfo(name="TrajectoryToVector", category="Custom")
public class VectorTrajectoryToVector implements java.io.Serializable {
private static final long serialVersionUID=1L;
// add your code here
@OutputInfo(name="Vector", options="serialization=false")
public double[] convert(
@ParamInfo(name="Trajectory", style="default", options="") VectorTrajectory vt,
@ParamInfo(name="Time Step", style="default", options="") int timeStep) {
double[] v = new double[vt[0].length-1]
for (int i = 0; i < v.length; i++) {
v[i] = vt[timeStep][i+1]
}
return v
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment