id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
139621153_65
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testAdd()\n\t{\n\t\tVectorN vec1 = VectorN.from(2, 1, 5);\n\t\tVectorN vec2 = VectorN.from(3, 4, 7);\n\t\t\n\t\tvec1.add(vec2);\n\t\tassertEquals(VectorN.from(5, 5, 12), vec1);\n\t\t\n\t\tvec1 = VectorN.from(-2, 0, -42);\n\t\tvec1.add(vec2);\n\t\tassertEquals(VectorN.from(1, 4, -35), v...
{ "fields": [ { "declarator": "data", "modifier": "private", "original_string": "private double[] data;", "type": "double[]", "var_name": "data" } ], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/vector/VectorN.java", "identifier": "VectorN", "interfa...
{ "body": "public VectorN add(final IVector vector)\n\t{\n\t\tcheckDimension(vector.getNumDimensions());\n\t\tfor (int i = 0; i < getNumDimensions(); i++)\n\t\t{\n\t\t\tdata[i] += vector.get(i);\n\t\t}\n\t\treturn this;\n\t}", "class_method_signature": "VectorN.add(final IVector vector)", "constructor": false, ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_32
{ "fields": [ { "declarator": "startCenter = Vector2.zero()", "modifier": "private", "original_string": "private IVector2 startCenter = Vector2.zero();", "type": "IVector2", "var_name": "startCenter" }, { "declarator": "endCenter = Vector2.fromXY(1000, 0)", "modif...
{ "body": "@Test\n\tpublic void testNearestPointOutside()\n\t{\n\t\tITube tube = Tube.create(startCenter, endCenter, radius);\n\t\tITube tubeZeroLength = Tube.create(startCenter, startCenter, radius);\n\t\t\n\t\tIVector2 pInside = Vector2.fromXY(0, 1);\n\t\tIVector2 nearestPointOutside = Vector2.fromXY(0, 10);\n\t\t\...
{ "fields": [ { "declarator": "startCenter", "modifier": "private final", "original_string": "private final IVector2 startCenter;", "type": "IVector2", "var_name": "startCenter" }, { "declarator": "endCenter", "modifier": "private final", "original_string": ...
{ "body": "@Override\n\tpublic IVector2 nearestPointOutside(final IVector2 point)\n\t{\n\t\tif (startCenter.equals(endCenter))\n\t\t{\n\t\t\treturn Circle.createCircle(startCenter, radius).nearestPointOutside(point);\n\t\t}\n\t\tIVector2 nearestPointOutside = point;\n\t\tILineSegment tubeLineSeg = Lines.segmentFromPo...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_117
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testAdd()\n\t{\n\t\tVector3 vec1 = Vector3.fromXYZ(2, 1, 5);\n\t\tVector3 vec2 = Vector3.fromXYZ(3, 4, 7);\n\t\t\n\t\tvec1.add(vec2);\n\t\tassertEquals(Vector3.fromXYZ(5, 5, 12), vec1);\n\t\t\n\t\tvec1 = Vector3.fromXYZ(-2, 0, -42);\n\t\tvec1.add(vec2);\n\t\tassertEquals(Vector3.fromXY...
{ "fields": [ { "declarator": "x", "modifier": "private", "original_string": "private double\tx;", "type": "double", "var_name": "x" }, { "declarator": "y", "modifier": "private", "original_string": "private double\ty;", "type": "double", "var_na...
{ "body": "public Vector3 add(final IVector3 vector)\n\t{\n\t\tx += vector.x();\n\t\ty += vector.y();\n\t\tz += vector.z();\n\t\treturn this;\n\t}", "class_method_signature": "Vector3.add(final IVector3 vector)", "constructor": false, "full_signature": "public Vector3 add(final IVector3 vector)", "identifier"...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_49
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/rectangle/RectangleTest.java", "identifier": "RectangleTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testNearestPointInsideWithBuildLine()\n\t{\n\t\tRectangle rect = Rectangle.fromCenter(Vector2.zero(), 2, 6);\n\t\tassertThat(rect.nearestPointInside(Vector2.fromXY(0, 0), Vector2.fromXY(0, 0))).isEqualTo(Vector2.fromXY(0, 0));\n\t\tassertThat(rect.nearestPointInside(Vector2.fromXY(0, 0...
{ "fields": [ { "declarator": "center", "modifier": "private final", "original_string": "private final Vector2f center;", "type": "Vector2f", "var_name": "center" }, { "declarator": "xExtent", "modifier": "private final", "original_string": "private final do...
{ "body": "public static Rectangle fromCenter(final IVector2 center, final double xExtent, final double yExtent)\n\t{\n\t\treturn new Rectangle(center, xExtent, yExtent);\n\t}", "class_method_signature": "Rectangle.fromCenter(final IVector2 center, final double xExtent, final double yExtent)", "constructor": fals...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_183
{ "fields": [ { "declarator": "lineConstructor = dV -> LineSegment.fromPoints(Vector2f.ZERO_VECTOR,\n\t\t\tVector2f.ZERO_VECTOR.addNew(dV))", "modifier": "private final static", "original_string": "private final static LineConstructor lineConstructor = dV -> LineSegment.fromPoints(Vector2f.ZERO_...
{ "body": "@Test\n\tpublic void testIntersectLine()\n\t{\n\t\tILine line = Line.fromPoints(Vector2f.ZERO_VECTOR, Vector2f.X_AXIS);\n\t\t\n\t\trotateSegment(0, 360, ((degAngle, radAngle, segment) -> {\n\t\t\t\n\t\t\tOptional<IVector2> intersection = segment.intersectLine(line);\n\t\t\tif (degAngle < 210 || degAngle > ...
{ "fields": [ { "declarator": "start", "modifier": "private final", "original_string": "private final Vector2f start;", "type": "Vector2f", "var_name": "start" }, { "declarator": "end", "modifier": "private final", "original_string": "private final Vector2f ...
{ "body": "@Override\n\tpublic Optional<IVector2> intersectLine(final ILine line)\n\t{\n\t\treturn line.intersectSegment(this);\n\t}", "class_method_signature": "LineSegment.intersectLine(final ILine line)", "constructor": false, "full_signature": "@Override public Optional<IVector2> intersectLine(final ILine l...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_245
{ "fields": [ { "declarator": "depth = 400", "modifier": "private", "original_string": "private double depth = 400;", "type": "double", "var_name": "depth" }, { "declarator": "length = 800", "modifier": "private", "original_string": "private double length = ...
{ "body": "@Test\n\tpublic void nearestPointOutside()\n\t{\n\t\tassertThat(penaltyArea.nearestPointOutside(center))\n\t\t\t\t.as(\"Center is outside and should be returned as-is\")\n\t\t\t\t.isEqualTo(center);\n\n\t\tassertThat(penaltyArea.nearestPointOutside(goalCenter))\n\t\t\t\t.as(\"Goal center should be moved to...
{ "fields": [ { "declarator": "goalCenterX", "modifier": "private final", "original_string": "private final double goalCenterX;", "type": "double", "var_name": "goalCenterX" }, { "declarator": "length", "modifier": "private final", "original_string": "privat...
{ "body": "@Override\n\tpublic IVector2 nearestPointOutside(final IVector2 point)\n\t{\n\t\tif (getRectangle().isPointInShape(point))\n\t\t{\n\t\t\treturn point.nearestTo(\n\t\t\t\t\tgetEdges().stream()\n\t\t\t\t\t\t\t.map(e -> e.closestPointOnLine(point))\n\t\t\t\t\t\t\t.collect(Collectors.toList()));\n\t\t}\n\t\tre...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_212
{ "fields": [ { "declarator": "ACCURACY = 1e-6", "modifier": "public static final", "original_string": "public static final double ACCURACY = 1e-6;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/angle/Rotatio...
{ "body": "@Test\n\tpublic void zero()\n\t{\n\t\tassertEquals(0, Rotation.zero().asRad(), ACCURACY);\n\t}", "class_method_signature": "RotationTest.zero()", "constructor": false, "full_signature": "@Test public void zero()", "identifier": "zero", "invocations": [ "assertEquals", "asRad", "zero" ...
{ "fields": [ { "declarator": "ZERO_ROTATION = new Rotation()", "modifier": "private static final", "original_string": "private static final Rotation ZERO_ROTATION = new Rotation();", "type": "Rotation", "var_name": "ZERO_ROTATION" } ], "file": "modules/common-math/src/main/j...
{ "body": "public static Rotation zero()\n\t{\n\t\treturn ZERO_ROTATION;\n\t}", "class_method_signature": "Rotation.zero()", "constructor": false, "full_signature": "public static Rotation zero()", "identifier": "zero", "invocations": [], "modifiers": "public static", "parameters": "()", "return": "Ro...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_204
{ "fields": [ { "declarator": "random", "modifier": "private", "original_string": "private Random random;", "type": "Random", "var_name": "random" }, { "declarator": "TEST_ACCURACY = 1e-3", "modifier": "private static final", "original_string": "private stat...
{ "body": "@Test\n\tpublic void testLeadPointOnLine()\n\t{\n\n\t\tILine line = Line.fromPoints(Vector2f.ZERO_VECTOR, Vector2f.X_AXIS);\n\t\tfor (double i = 0.0; i < 10; i += 0.1)\n\t\t{\n\t\t\tIVector2 point = Vector2.fromXY(i * i, Math.pow(10, i - 5));\n\t\t\tIVector2 expected = Vector2.fromXY(i * i, 0);\n\n\t\t\tAs...
{ "fields": [ { "declarator": "ACCURACY = SumatraMath.getEqualTol()", "modifier": "private static final", "original_string": "private static final double ACCURACY = SumatraMath.getEqualTol();", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/mai...
{ "body": "public static Vector2 leadPointOnLine(final ILine line, final IVector2 point)\n\t{\n\t\treturn getPointOnLineForLambda(\n\t\t\t\tline,\n\t\t\t\tgetLeadPointLambda(point, line));\n\t}", "class_method_signature": "LineMath.leadPointOnLine(final ILine line, final IVector2 point)", "constructor": false, ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_7
{ "fields": [ { "declarator": "kickPos = Vector2.fromXY(0, 0)", "modifier": "private static", "original_string": "private static IVector2 kickPos = Vector2.fromXY(0, 0);", "type": "IVector2", "var_name": "kickPos" }, { "declarator": "kickVel = Vector2.fromXY(8000, 0)", ...
{ "body": "@Test\n\tpublic void testGetPosByVel()\n\t{\n\t\tIVector finalPos = trajectory.getPosByVel(0);\n\t\tdouble tTotal = trajectory.getTimeByVel(0);\n\t\tdouble tStep = tTotal / 10;\n\t\t\n\t\tIBallTrajectory traj = trajectory;\n\t\t\n\t\tfor (double t = 0; t <= tTotal; t += tStep)\n\t\t{\n\t\t\tIVector2 posNow...
{ "fields": [ { "declarator": "params", "modifier": "private final", "original_string": "private final TwoPhaseFixedVelParameters params;", "type": "TwoPhaseFixedVelParameters", "var_name": "params" } ], "file": "modules/moduli-wp/src/main/java/edu/tigers/sumatra/wp/ball/traj...
{ "body": "public static TwoPhaseFixedVelBallTrajectory fromState(final IVector2 posNow, final IVector2 velNow,\n\t\t\tfinal TwoPhaseFixedVelParameters params)\n\t{\n\t\tdouble tSwitch = 0;\n\t\t\n\t\tif (velNow.getLength2() > params.vSwitch)\n\t\t{\n\t\t\t// ball is still in sliding phase\n\t\t\ttSwitch = -(velNow.g...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_195
{ "fields": [ { "declarator": "lineConstructor = dV -> Line.fromDirection(Vector2f.ZERO_VECTOR, dV)", "modifier": "private final static", "original_string": "private final static LineConstructor lineConstructor = dV -> Line.fromDirection(Vector2f.ZERO_VECTOR, dV);", "type": "LineConstructo...
{ "body": "@Test\n\tpublic void testGetYIntercept()\n\t{\n\t\tfor (int degAngle = -90; degAngle <= 90; degAngle += 10)\n\t\t{\n\t\t\tdouble angle = Math.toRadians(degAngle);\n\t\t\tIVector2 sV = Vector2.fromXY(1, 0);\n\t\t\tIVector2 dV = Vector2.fromAngle(angle);\n\t\t\t\n\t\t\tILine line = Line.fromDirection(sV, dV)...
{ "fields": [], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/line/v2/Line.java", "identifier": "Line", "interfaces": "implements ILine", "methods": [ { "class_method_signature": "Line.Line(final IVector2 supportVector, final IVector2 directionVector)", "constructor": true...
{ "body": "@Override\n\tpublic Optional<Double> getYIntercept()\n\t{\n\t\treturn LineMath.getYIntercept(this);\n\t}", "class_method_signature": "Line.getYIntercept()", "constructor": false, "full_signature": "@Override public Optional<Double> getYIntercept()", "identifier": "getYIntercept", "invocations": [...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_253
{ "fields": [], "file": "modules/sumatra-snapshot/src/test/java/edu/tigers/sumatra/snapshot/SnapObjectTest.java", "identifier": "SnapObjectTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testFromJSON() throws ParseException\n\t{\n\t\tJSONParser parser = new JSONParser();\n\t\tSnapObject obj = new SnapObject(Vector3.zero(), Vector3.zero());\n\t\tassertEquals(obj,\n\t\t\t\tSnapObject.fromJSON((JSONObject) parser.parse(\"{\\\"pos\\\":[0.0,0.0,0.0],\\\"vel\\\":[0.0,0.0,0.0...
{ "fields": [ { "declarator": "pos", "modifier": "private final", "original_string": "private final IVector3\tpos;", "type": "IVector3", "var_name": "pos" }, { "declarator": "vel", "modifier": "private final", "original_string": "private final IVector3\tvel;...
{ "body": "public static SnapObject fromJSON(final JSONObject obj)\n\t{\n\t\treturn new SnapObject(vec3FromJSON((JSONArray) obj.get(\"pos\")), vec3FromJSON((JSONArray) obj.get(\"vel\")));\n\t}", "class_method_signature": "SnapObject.fromJSON(final JSONObject obj)", "constructor": false, "full_signature": "publi...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_252
{ "fields": [], "file": "modules/sumatra-snapshot/src/test/java/edu/tigers/sumatra/snapshot/SnapObjectTest.java", "identifier": "SnapObjectTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testToJSON()\n\t{\n\t\tSnapObject obj = new SnapObject(Vector3.zero(), Vector3.zero());\n\t\tassertEquals(\"{\\\"pos\\\":[0.0,0.0,0.0],\\\"vel\\\":[0.0,0.0,0.0]}\", obj.toJSON().toJSONString());\n\t\tobj = new SnapObject(Vector3.fromXYZ(0, 1, 0), Vector3.zero());\n\t\tassertEquals(\"{\...
{ "fields": [ { "declarator": "pos", "modifier": "private final", "original_string": "private final IVector3\tpos;", "type": "IVector3", "var_name": "pos" }, { "declarator": "vel", "modifier": "private final", "original_string": "private final IVector3\tvel;...
{ "body": "@SuppressWarnings(\"unchecked\")\n\tpublic JSONObject toJSON()\n\t{\n\t\tJSONObject obj = new JSONObject();\n\t\tobj.put(\"pos\", vec3ToJSON(pos));\n\t\tobj.put(\"vel\", vec3ToJSON(vel));\n\t\treturn obj;\n\t}", "class_method_signature": "SnapObject.toJSON()", "constructor": false, "full_signature": ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_6
{ "fields": [ { "declarator": "params", "modifier": "private", "original_string": "private FixedLossPlusRollingParameters params;", "type": "FixedLossPlusRollingParameters", "var_name": "params" }, { "declarator": "consultant", "modifier": "private", "origin...
{ "body": "@Test\n\tpublic void testGetInitVelForPeakHeight()\n\t{\n\t\tdouble kickVel = consultant.getInitVelForPeakHeight(200);\n\t\tdouble distMin = consultant.getMinimumDistanceToOverChip(kickVel, 200);\n\t\tdouble distMax = consultant.getMaximumDistanceToOverChip(kickVel, 200);\n\t\tassertEquals(0, distMin - dis...
{ "fields": [ { "declarator": "chipAngle = AngleMath.deg2rad(45)", "modifier": "private", "original_string": "private double chipAngle = AngleMath.deg2rad(45);", "type": "double", "var_name": "chipAngle" }, { "declarator": "params", "modifier": "private final", ...
{ "body": "@Override\n\tpublic double getInitVelForPeakHeight(final double height)\n\t{\n\t\tfinal double g = 9810;\n\t\t\n\t\t// initial z velocity in [m/s]\n\t\tdouble velZ = SumatraMath.sqrt(2.0 * g * height) * 0.001;\n\t\t\n\t\treturn velZ / SumatraMath.sin(chipAngle);\n\t}", "class_method_signature": "FixedLos...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_194
{ "fields": [ { "declarator": "lineConstructor = dV -> Line.fromDirection(Vector2f.ZERO_VECTOR, dV)", "modifier": "private final static", "original_string": "private final static LineConstructor lineConstructor = dV -> Line.fromDirection(Vector2f.ZERO_VECTOR, dV);", "type": "LineConstructo...
{ "body": "@Test\n\tpublic void testDistanceTo()\n\t{\n\t\tIVector2 sV = Vector2.fromXY(0, 0);\n\t\tIVector2 dV = Vector2.fromXY(0, 1);\n\t\tILine line = Line.fromDirection(sV, dV);\n\t\tILine invalidLine = Line.fromDirection(sV, Vector2f.ZERO_VECTOR);\n\t\t\n\t\tfor (int i = -10; i <= 10; i += 1)\n\t\t{\n\t\t\tasser...
{ "fields": [], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/line/v2/Line.java", "identifier": "Line", "interfaces": "implements ILine", "methods": [ { "class_method_signature": "Line.Line(final IVector2 supportVector, final IVector2 directionVector)", "constructor": true...
{ "body": "public static ILine fromDirection(final IVector2 supportVector, final IVector2 directionVector)\n\t{\n\t\treturn createNewFromVectorCopy(supportVector, directionVector);\n\t}", "class_method_signature": "Line.fromDirection(final IVector2 supportVector, final IVector2 directionVector)", "constructor": f...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_205
{ "fields": [ { "declarator": "random", "modifier": "private", "original_string": "private Random random;", "type": "Random", "var_name": "random" }, { "declarator": "TEST_ACCURACY = 1e-3", "modifier": "private static final", "original_string": "private stat...
{ "body": "@Test\n\tpublic void testStepAlongLine()\n\t{\n\t\tfor (double length = 0.0; length < 1000; length += 1)\n\t\t{\n\t\t\tfinal double s1 = random.nextDouble() - 0.5;\n\t\t\tfinal double s2 = random.nextDouble() - 0.5;\n\t\t\tfinal double r1 = random.nextDouble();\n\t\t\tfinal double r2 = random.nextDouble();...
{ "fields": [ { "declarator": "ACCURACY = SumatraMath.getEqualTol()", "modifier": "private static final", "original_string": "private static final double ACCURACY = SumatraMath.getEqualTol();", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/mai...
{ "body": "public static IVector2 stepAlongLine(final IVector2 start, final IVector2 end, final double stepSize)\n\t{\n\t\treturn edu.tigers.sumatra.math.line.v2.LineMath.stepAlongLine(start, end, stepSize);\n\t}", "class_method_signature": "LineMath.stepAlongLine(final IVector2 start, final IVector2 end, final dou...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_213
{ "fields": [ { "declarator": "ACCURACY = 1e-6", "modifier": "public static final", "original_string": "public static final double ACCURACY = 1e-6;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/angle/Rotatio...
{ "body": "@Test\n\tpublic void ofRad()\n\t{\n\t\tassertEquals(0, Rotation.ofRad(0).asRad(), ACCURACY);\n\t\tassertEquals(Math.PI * 2, Rotation.ofRad(Math.PI * 2).asRad(), ACCURACY);\n\t\tassertEquals(Math.PI * 100, Rotation.ofRad(Math.PI * 100).asRad(), ACCURACY);\n\t\tassertEquals(90, Rotation.ofRad(Math.PI / 2).as...
{ "fields": [ { "declarator": "ZERO_ROTATION = new Rotation()", "modifier": "private static final", "original_string": "private static final Rotation ZERO_ROTATION = new Rotation();", "type": "Rotation", "var_name": "ZERO_ROTATION" } ], "file": "modules/common-math/src/main/j...
{ "body": "public static Rotation ofRad(double rad)\n\t{\n\t\treturn new Rotation(rad);\n\t}", "class_method_signature": "Rotation.ofRad(double rad)", "constructor": false, "full_signature": "public static Rotation ofRad(double rad)", "identifier": "ofRad", "invocations": [], "modifiers": "public static",...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_244
{ "fields": [ { "declarator": "depth = 400", "modifier": "private", "original_string": "private double depth = 400;", "type": "double", "var_name": "depth" }, { "declarator": "length = 800", "modifier": "private", "original_string": "private double length = ...
{ "body": "@Test\n\tpublic void projectPointOnToPenaltyAreaBorder()\n\t{\n\t\tassertThat(penaltyArea.projectPointOnToPenaltyAreaBorder(Vector2.fromXY(0, 0)))\n\t\t\t\t.as(\"Center does not project to front border center\")\n\t\t\t\t.isEqualTo(penBorderCenter);\n\n\t\tassertThat(penaltyArea.projectPointOnToPenaltyArea...
{ "fields": [ { "declarator": "goalCenterX", "modifier": "private final", "original_string": "private final double goalCenterX;", "type": "double", "var_name": "goalCenterX" }, { "declarator": "length", "modifier": "private final", "original_string": "privat...
{ "body": "@Override\n\t@SuppressWarnings(\"squid:S1244\") // equality check intended\n\tpublic IVector2 projectPointOnToPenaltyAreaBorder(final IVector2 point)\n\t{\n\t\tif (point.x() * Math.signum(getGoalCenter().x()) >= Math.abs(getGoalCenter().x()))\n\t\t{\n\t\t\tif (point.y() == 0.0)\n\t\t\t{\n\t\t\t\treturn get...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_48
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/rectangle/RectangleTest.java", "identifier": "RectangleTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testIsIntersectionWithLine()\n\t{\n\t\tRectangle rect = Rectangle.fromCenter(Vector2.zero(), 2, 42);\n\t\t\n\t\tILine line = Line.fromDirection(Vector2.zero(), Vector2.fromX(1));\n\t\tassertThat(rect.isIntersectingWithLine(line)).isTrue();\n\t\t\n\t\tline = Line.fromDirection(Vector2.f...
{ "fields": [ { "declarator": "center", "modifier": "private final", "original_string": "private final Vector2f center;", "type": "Vector2f", "var_name": "center" }, { "declarator": "xExtent", "modifier": "private final", "original_string": "private final do...
{ "body": "public static Rectangle fromCenter(final IVector2 center, final double xExtent, final double yExtent)\n\t{\n\t\treturn new Rectangle(center, xExtent, yExtent);\n\t}", "class_method_signature": "Rectangle.fromCenter(final IVector2 center, final double xExtent, final double yExtent)", "constructor": fals...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_182
{ "fields": [ { "declarator": "lineConstructor = dV -> LineSegment.fromPoints(Vector2f.ZERO_VECTOR,\n\t\t\tVector2f.ZERO_VECTOR.addNew(dV))", "modifier": "private final static", "original_string": "private final static LineConstructor lineConstructor = dV -> LineSegment.fromPoints(Vector2f.ZERO_...
{ "body": "@Test\n\tpublic void testCopy()\n\t{\n\t\tILineSegment original = LineSegment.fromOffset(Vector2.fromXY(0, 0), Vector2.fromXY(1, 1));\n\t\tILineSegment copy = original.copy();\n\t\t\n\t\tassertThat(original.getStart(), is(copy.getStart()));\n\t\tassertThat(original.getEnd(), is(copy.getEnd()));\n\t\tassert...
{ "fields": [ { "declarator": "start", "modifier": "private final", "original_string": "private final Vector2f start;", "type": "Vector2f", "var_name": "start" }, { "declarator": "end", "modifier": "private final", "original_string": "private final Vector2f ...
{ "body": "@Override\n\tpublic ILineSegment copy()\n\t{\n\t\treturn fromPoints(getStart(), getEnd());\n\t}", "class_method_signature": "LineSegment.copy()", "constructor": false, "full_signature": "@Override public ILineSegment copy()", "identifier": "copy", "invocations": [ "fromPoints", "getStart"...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_33
{ "fields": [ { "declarator": "startCenter = Vector2.zero()", "modifier": "private", "original_string": "private IVector2 startCenter = Vector2.zero();", "type": "IVector2", "var_name": "startCenter" }, { "declarator": "endCenter = Vector2.fromXY(1000, 0)", "modif...
{ "body": "@Test\n\tpublic void testNearestPointInside()\n\t{\n\t\tITube tube = Tube.create(startCenter, endCenter, radius);\n\t\tITube tubeZeroLength = Tube.create(startCenter, startCenter, radius);\n\t\t\n\t\tIVector2 nearestPointInside = Vector2.fromXY(0, 9);\n\t\tIVector2 pOutside = Vector2.fromXY(0, 11);\n\t\t\n...
{ "fields": [ { "declarator": "startCenter", "modifier": "private final", "original_string": "private final IVector2 startCenter;", "type": "IVector2", "var_name": "startCenter" }, { "declarator": "endCenter", "modifier": "private final", "original_string": ...
{ "body": "@Override\n\tpublic IVector2 nearestPointInside(final IVector2 point)\n\t{\n\t\tILineSegment tubeLineSeg = Lines.segmentFromPoints(startCenter, endCenter);\n\t\tif (tubeLineSeg.distanceTo(point) < radius)\n\t\t{\n\t\t\treturn point;\n\t\t}\n\t\tIVector2 leadPoint = tubeLineSeg.closestPointOnLine(point);\n\...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_116
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/VectorLengthComparatorTest.java", "identifier": "VectorLengthComparatorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testCompare()\n\t{\n\t\tList<IVector2> points = new ArrayList<>();\n\t\tRandom rnd = new Random(43);\n\t\tfor (int i = 0; i < 100; i++)\n\t\t{\n\t\t\tpoints.add(Vector2.fromXY(rnd.nextDouble() * 5000 - 2500, rnd.nextDouble() * 5000 - 2500));\n\t\t}\n\t\tpoints.add(Vector2.zero());\n\t\...
{ "fields": [], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/vector/VectorLengthComparator.java", "identifier": "VectorLengthComparator", "interfaces": "implements Comparator<IVector2>", "methods": [ { "class_method_signature": "VectorLengthComparator.compare(final IVector2 o1,...
{ "body": "@Override\n\tpublic int compare(final IVector2 o1, final IVector2 o2)\n\t{\n\t\tdouble len1 = o1.getLength2();\n\t\tdouble len2 = o2.getLength2();\n\t\tif (len1 < len2)\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\tif (len2 < len1)\n\t\t{\n\t\t\treturn 1;\n\t\t}\n\t\treturn 0;\n\t}", "class_method_signature": "Ve...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_141
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Vector3fTest.java", "identifier": "Vector3fTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testFrom2d()\n\t{\n\t\tassertThat(Vector3f.from2d(Vector2.fromXY(42, 1337), 3.14)).isEqualTo(Vector3.fromXYZ(42, 1337, 3.14));\n\t\tassertThat(Vector3f.from2d(Vector2.fromXY(42, 1337), 3.14)).isNotEqualTo(Vector3.zero());\n\t}", "class_method_signature": "Vector3fTest.testFrom2d()", ...
{ "fields": [ { "declarator": "X_AXIS = fromXYZ(1, 0, 0)", "modifier": "public static final", "original_string": "public static final Vector3f X_AXIS = fromXYZ(1, 0, 0);", "type": "Vector3f", "var_name": "X_AXIS" }, { "declarator": "Y_AXIS = fromXYZ(0, 1, 0)", "mo...
{ "body": "public static Vector3f from2d(final IVector2 xy, final double z)\n\t{\n\t\treturn new Vector3f(xy.x(), xy.y(), z);\n\t}", "class_method_signature": "Vector3f.from2d(final IVector2 xy, final double z)", "constructor": false, "full_signature": "public static Vector3f from2d(final IVector2 xy, final dou...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_64
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Vector2fTest.java", "identifier": "Vector2fTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testGetXYZVector()\n\t{\n\t\tassertThat(Vector2f.fromXY(42, 1337).getXYZVector()).isEqualTo(Vector3.fromXYZ(42, 1337, 0));\n\t}", "class_method_signature": "Vector2fTest.testGetXYZVector()", "constructor": false, "full_signature": "@Test public void testGetXYZVector()", "identi...
{ "fields": [ { "declarator": "X_AXIS = fromXY(1, 0)", "modifier": "public static final", "original_string": "public static final Vector2f X_AXIS = fromXY(1, 0);", "type": "Vector2f", "var_name": "X_AXIS" }, { "declarator": "Y_AXIS = fromXY(0, 1)", "modifier": "pu...
{ "body": "public static Vector2f fromXY(final double x, final double y)\n\t{\n\t\treturn new Vector2f(x, y);\n\t}", "class_method_signature": "Vector2f.fromXY(final double x, final double y)", "constructor": false, "full_signature": "public static Vector2f fromXY(final double x, final double y)", "identifier...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_72
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testSet()\n\t{\n\t\tVectorN vector = VectorN.zero(3);\n\t\tvector.set(0, 42);\n\t\tassertThat(vector.isCloseTo(VectorN.from(42, 0, 0))).isTrue();\n\t\tvector.set(1, 21);\n\t\tassertThat(vector.isCloseTo(VectorN.from(42, 21, 0))).isTrue();\n\t\tvector.set(2, 10);\n\t\tassertThat(vector....
{ "fields": [ { "declarator": "data", "modifier": "private", "original_string": "private double[] data;", "type": "double[]", "var_name": "data" } ], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/vector/VectorN.java", "identifier": "VectorN", "interfa...
{ "body": "public void set(final int i, final double value)\n\t{\n\t\tif (i >= getNumDimensions())\n\t\t{\n\t\t\tthrow new IllegalArgumentException(\"index too large: \" + i);\n\t\t}\n\t\tdata[i] = value;\n\t}", "class_method_signature": "VectorN.set(final int i, final double value)", "constructor": false, "ful...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_157
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/SumatraMathTest.java", "identifier": "SumatraMathTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testQuadraticFunctionRoots()\n\t{\n\t\tList<Double> roots;\n\t\t\n\t\t// test constant function => no roots\n\t\tAssert.assertTrue(SumatraMath.quadraticFunctionRoots(0, 0, 1).isEmpty());\n\t\t\n\t\t// test linear function => single root\n\t\troots = SumatraMath.quadraticFunctionRoots(0...
{ "fields": [ { "declarator": "EQUAL_TOL = 1e-3", "modifier": "private static final", "original_string": "private static final double EQUAL_TOL = 1e-3;", "type": "double", "var_name": "EQUAL_TOL" } ], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/SumatraM...
{ "body": "public static List<Double> quadraticFunctionRoots(final double a, final double b, final double c)\n\t{\n\t\tList<Double> roots = new ArrayList<>();\n\t\t\n\t\tif (isEqual(a, 0.0))\n\t\t{\n\t\t\tif (isEqual(b, 0.0))\n\t\t\t{\n\t\t\t\t// the function is of constant form 'c = 0' => no roots\n\t\t\t\treturn ro...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_229
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/triangle/TriangleTest.java", "identifier": "TriangleTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testIsPointInShapeWithMargin()\n\t{\n\t\tdouble margin = 250d;\n\t\tVector2 a = Vector2.fromXY(0.0, 0.0);\n\t\tVector2 b = Vector2.fromXY(1000.0, 0.0);\n\t\tVector2 c = Vector2.fromXY(0.0, 1000.0);\n\t\t\n\t\tTriangle triangle = Triangle.fromCorners(a, b, c);\n\n\t\tILineSegment abSegm...
{ "fields": [ { "declarator": "a", "modifier": "private final", "original_string": "private final IVector2 a;", "type": "IVector2", "var_name": "a" }, { "declarator": "b", "modifier": "private final", "original_string": "private final IVector2 b;", "ty...
{ "body": "public static Triangle fromCorners(final IVector2 a, final IVector2 b, final IVector2 c)\n\t{\n\t\treturn new Triangle(a, b, c);\n\t}", "class_method_signature": "Triangle.fromCorners(final IVector2 a, final IVector2 b, final IVector2 c)", "constructor": false, "full_signature": "public static Triang...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_100
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testSet()\n\t{\n\t\tVector2 vector = Vector2.zero();\n\t\tassertThat(vector.isCloseTo(Vector2f.ZERO_VECTOR)).isTrue();\n\t\tvector.set(0, 42);\n\t\tassertThat(vector.isCloseTo(Vector2.fromX(42))).isTrue();\n\t\tvector.set(1, 21);\n\t\tassertThat(vector.isCloseTo(Vector2.fromXY(42, 21))...
{ "fields": [ { "declarator": "x", "modifier": "private", "original_string": "private double x;", "type": "double", "var_name": "x" }, { "declarator": "y", "modifier": "private", "original_string": "private double y;", "type": "double", "var_name...
{ "body": "public Vector2 set(final IVector original)\n\t{\n\t\tsetX(original.x());\n\t\tsetY(original.y());\n\t\treturn this;\n\t}", "class_method_signature": "Vector2.set(final IVector original)", "constructor": false, "full_signature": "public Vector2 set(final IVector original)", "identifier": "set", "i...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_25
{ "fields": [ { "declarator": "ACCURACY = 1e-3", "modifier": "private static final", "original_string": "private static final double ACCURACY = 1e-3;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/circle/Circ...
{ "body": "@Test\n\tpublic void testNearestPointOutside()\n\t{\n\t\t// Test true\n\t\tICircle circle = Circle.createCircle(Vector2.fromXY(-2, 4), 3);\n\t\tVector2 point = Vector2.fromXY(-1, 4);\n\t\tAssert.assertEquals(circle.nearestPointOutside(point), Vector2.fromXY(1, 4));\n\t\t\n\t\t// Test false\n\t\tVector2 poi...
{ "fields": [ { "declarator": "center", "modifier": "private final", "original_string": "private final Vector2f center;", "type": "Vector2f", "var_name": "center" }, { "declarator": "radius", "modifier": "private final", "original_string": "private final dou...
{ "body": "public static ICircle createCircle(final IVector2 center, final double radius)\n\t{\n\t\treturn new Circle(center, radius);\n\t}", "class_method_signature": "Circle.createCircle(final IVector2 center, final double radius)", "constructor": false, "full_signature": "public static ICircle createCircle(f...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_52
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/quadrilateral/QuadrilateralTest.java", "identifier": "QuadrilateralTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testEquals()\n\t{\n\t\tEqualsVerifier.forClass(Quadrilateral.class)\n\t\t\t\t.verify();\n\t}", "class_method_signature": "QuadrilateralTest.testEquals()", "constructor": false, "full_signature": "@Test public void testEquals()", "identifier": "testEquals", "invocations": [ ...
{ "fields": [ { "declarator": "corners = new ArrayList<>(4)", "modifier": "private final", "original_string": "private final List<IVector2> corners = new ArrayList<>(4);", "type": "List<IVector2>", "var_name": "corners" } ], "file": "modules/common-math/src/main/java/edu/tige...
{ "body": "@Override\n\tpublic final boolean equals(final Object o)\n\t{\n\t\tif (this == o)\n\t\t\treturn true;\n\t\t\n\t\tif (o == null || getClass() != o.getClass())\n\t\t\treturn false;\n\t\t\n\t\tfinal Quadrilateral that = (Quadrilateral) o;\n\t\t\n\t\treturn new EqualsBuilder()\n\t\t\t\t.append(corners, that.co...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_177
{ "fields": [ { "declarator": "lineConstructor = dV -> LineSegment.fromPoints(Vector2f.ZERO_VECTOR,\n\t\t\tVector2f.ZERO_VECTOR.addNew(dV))", "modifier": "private final static", "original_string": "private final static LineConstructor lineConstructor = dV -> LineSegment.fromPoints(Vector2f.ZERO_...
{ "body": "@Test\n\tpublic void testIsValid()\n\t{\n\t\tIVector2 start = Vector2.fromXY(10, -20);\n\t\tIVector2 end = Vector2f.ZERO_VECTOR;\n\t\t\n\t\tILineSegment properLine = LineSegment.fromPoints(start, end);\n\t\tILineSegment invalidLine = LineSegment.fromPoints(start, start);\n\t\t\n\t\tassertThat(properLine.is...
{ "fields": [ { "declarator": "start", "modifier": "private final", "original_string": "private final Vector2f start;", "type": "Vector2f", "var_name": "start" }, { "declarator": "end", "modifier": "private final", "original_string": "private final Vector2f ...
{ "body": "@Override\n\tpublic boolean isValid()\n\t{\n\t\treturn !directionVector().isZeroVector();\n\t}", "class_method_signature": "LineSegment.isValid()", "constructor": false, "full_signature": "@Override public boolean isValid()", "identifier": "isValid", "invocations": [ "isZeroVector", "dire...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_198
{ "fields": [ { "declarator": "lineConstructor = dV -> Line.fromDirection(Vector2f.ZERO_VECTOR, dV)", "modifier": "private final static", "original_string": "private final static LineConstructor lineConstructor = dV -> Line.fromDirection(Vector2f.ZERO_VECTOR, dV);", "type": "LineConstructo...
{ "body": "@Test\n\tpublic void testIsPointOnInvalidLine()\n\t{\n\t\tIVector2 sV = Vector2.fromXY(10, 56);\n\t\tILine invalidLine = Line.fromDirection(sV, Vector2f.ZERO_VECTOR);\n\t\t\n\t\tassertThat(invalidLine.isPointOnLine(Vector2f.ZERO_VECTOR), is(false));\n\t\tassertThat(invalidLine.isPointOnLine(Vector2.fromXY(...
{ "fields": [], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/line/v2/Line.java", "identifier": "Line", "interfaces": "implements ILine", "methods": [ { "class_method_signature": "Line.Line(final IVector2 supportVector, final IVector2 directionVector)", "constructor": true...
{ "body": "public static ILine fromDirection(final IVector2 supportVector, final IVector2 directionVector)\n\t{\n\t\treturn createNewFromVectorCopy(supportVector, directionVector);\n\t}", "class_method_signature": "Line.fromDirection(final IVector2 supportVector, final IVector2 directionVector)", "constructor": f...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_120
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testSubtract()\n\t{\n\t\tVector3 vec1 = Vector3.fromXYZ(4, 2, 1);\n\t\tVector3 vec2 = Vector3.fromXYZ(3, 5, 2);\n\t\tvec1.subtract(vec2);\n\t\tassertEquals(Vector3.fromXYZ(1, -3, -1), vec1);\n\t\t\n\t\tvec1 = Vector3.fromXYZ(1, 5, 5);\n\t\tvec2 = Vector3.fromXYZ(-2, 5, -3);\n\t\tvec1.s...
{ "fields": [ { "declarator": "x", "modifier": "private", "original_string": "private double\tx;", "type": "double", "var_name": "x" }, { "declarator": "y", "modifier": "private", "original_string": "private double\ty;", "type": "double", "var_na...
{ "body": "public Vector3 subtract(final IVector3 vector)\n\t{\n\t\tx -= vector.x();\n\t\ty -= vector.y();\n\t\tz -= vector.z();\n\t\treturn this;\n\t}", "class_method_signature": "Vector3.subtract(final IVector3 vector)", "constructor": false, "full_signature": "public Vector3 subtract(final IVector3 vector)",...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_209
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/line/LineTest.java", "identifier": "LineTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void textGetSlope()\n\t{\n\t\tVector2 vecS = Vector2.fromXY(1, 1);\n\t\tVector2 vecD = Vector2.fromXY(1, 1);\n\t\tLine line1 = Line.fromDirection(vecS, vecD);\n\t\tassertThat(line1.getSlope().isPresent(), is(true));\n\t\tassertThat(line1.getSlope().get(), IsCloseTo.closeTo(1.0, 1e-6));\n\t\...
{ "fields": [ { "declarator": "supportVector", "modifier": "private final", "original_string": "private final IVector2 supportVector;", "type": "IVector2", "var_name": "supportVector" }, { "declarator": "directionVector", "modifier": "private final", "origin...
{ "body": "public static Line fromDirection(final IVector2 supportVector, final IVector2 directionVector)\n\t{\n\t\treturn new Line(supportVector, directionVector);\n\t}", "class_method_signature": "Line.fromDirection(final IVector2 supportVector, final IVector2 directionVector)", "constructor": false, "full_si...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_13
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/circle/CircleMathTest.java", "identifier": "CircleMathTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void isPointInArc180degStart0deg()\n\t{\n\t\tdouble radius = 300;\n\t\tdouble margin = 0.0;\n\t\tdouble start = 0;\n\t\tdouble rotation = AngleMath.PI;\n\t\tIVector2 center = Vector2.fromXY(-100, 500);\n\t\tIArc arc = Arc.createArc(center, radius, start, rotation);\n\t\tassertThat(CircleMat...
{ "fields": [], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/circle/CircleMath.java", "identifier": "CircleMath", "interfaces": "", "methods": [ { "class_method_signature": "CircleMath.CircleMath()", "constructor": true, "full_signature": "@SuppressWarnings(\"unused...
{ "body": "public static boolean isPointInArc(final IArc arc, final IVector2 point, double margin)\n\t{\n\t\tif (!CircleMath.isPointInCircle(arc, point, margin))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (arc.center().equals(point))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tIVector2 dir = point.subtractNew(arc.ce...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_136
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testFromArray()\n\t{\n\t\tassertThat(Vector3.fromArray(new double[] { 42, 1337, 3.14 })).isEqualTo(Vector3.fromXYZ(42, 1337, 3.14));\n\t\tassertThatThrownBy(() -> Vector3.fromArray(new double[] { 1 }))\n\t\t\t\t.isExactlyInstanceOf(IllegalArgumentException.class);\n\t}", "class_metho...
{ "fields": [ { "declarator": "x", "modifier": "private", "original_string": "private double\tx;", "type": "double", "var_name": "x" }, { "declarator": "y", "modifier": "private", "original_string": "private double\ty;", "type": "double", "var_na...
{ "body": "public static Vector3 fromArray(final double[] arr)\n\t{\n\t\tif (arr.length != 3)\n\t\t{\n\t\t\tthrow new IllegalArgumentException(\"Invalid input size\");\n\t\t}\n\t\treturn new Vector3(arr[0], arr[1], arr[2]);\n\t}", "class_method_signature": "Vector3.fromArray(final double[] arr)", "constructor": f...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_161
{ "fields": [ { "declarator": "lineConstructor = dV -> HalfLine.fromDirection(Vector2f.ZERO_VECTOR, dV)", "modifier": "private final static", "original_string": "private final static LineConstructor lineConstructor = dV -> HalfLine.fromDirection(Vector2f.ZERO_VECTOR, dV);", "type": "LineCo...
{ "body": "@Test\n\tpublic void testCopy()\n\t{\n\t\tIHalfLine original = HalfLine.fromDirection(Vector2.fromXY(0, 0), Vector2.fromXY(1, 1));\n\t\tIHalfLine copy = original.copy();\n\t\t\n\t\tassertThat(original.supportVector(), is(copy.supportVector()));\n\t\tassertThat(original.supportVector() == copy.supportVector...
{ "fields": [], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/line/v2/HalfLine.java", "identifier": "HalfLine", "interfaces": "implements IHalfLine", "methods": [ { "class_method_signature": "HalfLine.HalfLine(final IVector2 supportVector, final IVector2 directionVector)", ...
{ "body": "@Override\n\tpublic IHalfLine copy()\n\t{\n\t\tIVector2 supportVector = supportVector().copy();\n\t\tIVector2 directionVector = directionVector().copy();\n\t\treturn new HalfLine(supportVector, directionVector);\n\t}", "class_method_signature": "HalfLine.copy()", "constructor": false, "full_signature...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_44
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/rectangle/RectangleTest.java", "identifier": "RectangleTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testIsPointInShape()\n\t{\n\t\tRectangle rect = Rectangle.fromCenter(Vector2.zero(), 42, 42);\n\t\tassertThat(rect.isPointInShape(Vector2.fromXY(0, 0))).isTrue();\n\t\tassertThat(rect.isPointInShape(Vector2.fromXY(1000, 1000))).isFalse();\n\t\tassertThat(rect.isPointInShape(Vector2.fro...
{ "fields": [ { "declarator": "center", "modifier": "private final", "original_string": "private final Vector2f center;", "type": "Vector2f", "var_name": "center" }, { "declarator": "xExtent", "modifier": "private final", "original_string": "private final do...
{ "body": "public static Rectangle fromCenter(final IVector2 center, final double xExtent, final double yExtent)\n\t{\n\t\treturn new Rectangle(center, xExtent, yExtent);\n\t}", "class_method_signature": "Rectangle.fromCenter(final IVector2 center, final double xExtent, final double yExtent)", "constructor": fals...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_248
{ "fields": [], "file": "modules/moduli-geometry/src/test/java/edu/tigers/sumatra/geometry/NGeometryTest.java", "identifier": "NGeometryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testGetTeamOfClosestGoalLine()\n\t{\n\t\tETeamColor leftTeam = Geometry.getNegativeHalfTeam();\n\t\t\n\t\tassertEquals(leftTeam, NGeometry.getTeamOfClosestGoalLine(Vector2.fromXY(-5, 0)));\n\t\tassertEquals(leftTeam.opposite(), NGeometry.getTeamOfClosestGoalLine(Vector2.fromXY(5, 0)));...
{ "fields": [], "file": "modules/moduli-geometry/src/main/java/edu/tigers/sumatra/geometry/NGeometry.java", "identifier": "NGeometry", "interfaces": "", "methods": [ { "class_method_signature": "NGeometry.NGeometry()", "constructor": true, "full_signature": "private NGeometry()", ...
{ "body": "public static ETeamColor getTeamOfClosestGoalLine(final IVector2 pos)\n\t{\n\t\tILineSegment blueGoalLine = NGeometry.getGoal(ETeamColor.BLUE).getGoalLine();\n\t\tILineSegment yellowGoalLine = NGeometry.getGoal(ETeamColor.YELLOW).getGoalLine();\n\t\t\n\t\tif (blueGoalLine.distanceTo(pos) < yellowGoalLine.d...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_233
{ "fields": [], "file": "modules/common/src/test/java/edu/tigers/sumatra/ids/BotIDTest.java", "identifier": "BotIDTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testEquals()\n\t{\n\t\tBotID bot0blue = BotID.createBotId(0, ETeamColor.BLUE);\n\t\tBotID bot0blueTigers = BotID.createBotId(0, ETeamColor.BLUE);\n\t\tBotID bot0Yellow = BotID.createBotId(0, ETeamColor.YELLOW);\n\t\tBotID bot1blue = BotID.createBotId(1, ETeamColor.BLUE);\n\t\tBotID bot...
{ "fields": [ { "declarator": "teamColor", "modifier": "private final", "original_string": "private final ETeamColor teamColor;", "type": "ETeamColor", "var_name": "teamColor" }, { "declarator": "NO_BOT_ID = new BotID()", "modifier": "private static final", ...
{ "body": "@Override\n\tpublic boolean equals(final Object obj)\n\t{\n\t\tif (this == obj)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\tif (!super.equals(obj))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (getClass() != obj.getClass())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tBotID other = (BotID) obj;\n\t\treturn teamColor =...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_87
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testAddNew()\n\t{\n\t\tVector2 vec1 = Vector2.fromXY(5, 7);\n\t\tVector2 vec2 = Vector2.fromXY(1, 2);\n\t\tVector2 result = vec1.addNew(vec2);\n\t\tassertEquals(Vector2.fromXY(6, 9), result);\n\t\t\n\t\tvec1 = Vector2.fromXY(-3, 0);\n\t\tvec2 = Vector2.fromXY(4, 2);\n\t\tresult = vec1....
{ "fields": [ { "declarator": "x", "modifier": "private", "original_string": "private double x;", "type": "double", "var_name": "x" }, { "declarator": "y", "modifier": "private", "original_string": "private double y;", "type": "double", "var_name...
{ "body": "public static Vector2 fromXY(final double x, final double y)\n\t{\n\t\treturn new Vector2(x, y);\n\t}", "class_method_signature": "Vector2.fromXY(final double x, final double y)", "constructor": false, "full_signature": "public static Vector2 fromXY(final double x, final double y)", "identifier": "...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_68
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testSubtract()\n\t{\n\t\tVectorN vec1 = VectorN.from(4, 2, 1);\n\t\tVectorN vec2 = VectorN.from(3, 5, 2);\n\t\tvec1.subtract(vec2);\n\t\tassertEquals(VectorN.from(1, -3, -1), vec1);\n\t\t\n\t\tvec1 = VectorN.from(1, 5, 5);\n\t\tvec2 = VectorN.from(-2, 5, -3);\n\t\tvec1.subtract(vec2);\...
{ "fields": [ { "declarator": "data", "modifier": "private", "original_string": "private double[] data;", "type": "double[]", "var_name": "data" } ], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/vector/VectorN.java", "identifier": "VectorN", "interfa...
{ "body": "public VectorN subtract(final IVector vector)\n\t{\n\t\tcheckDimension(vector.getNumDimensions());\n\t\tfor (int i = 0; i < getNumDimensions(); i++)\n\t\t{\n\t\t\tdata[i] -= vector.get(i);\n\t\t}\n\t\treturn this;\n\t}", "class_method_signature": "VectorN.subtract(final IVector vector)", "constructor":...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_91
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testScaleTo()\n\t{\n\t\tVector2 vec1 = Vector2.fromXY(3, -4);\n\t\tvec1.scaleTo(15.0f);\n\t\tassertEquals(Vector2.fromXY(9, -12), vec1);\n\t\t\n\t\tvec1 = Vector2.fromXY(2.5f, 2.5);\n\t\tvec1.scaleTo(12.5f);\n\t\tassertEquals(vec1.x(), 8.8388, ACCURACY);\n\t\tassertEquals(vec1.y(), 8.8...
{ "fields": [ { "declarator": "x", "modifier": "private", "original_string": "private double x;", "type": "double", "var_name": "x" }, { "declarator": "y", "modifier": "private", "original_string": "private double y;", "type": "double", "var_name...
{ "body": "public Vector2 scaleTo(final double newLength)\n\t{\n\t\tfinal double oldLength = getLength2();\n\t\tif (!SumatraMath.isZero(oldLength))\n\t\t{\n\t\t\treturn multiply(newLength / oldLength);\n\t\t}\n\t\treturn this;\n\t}", "class_method_signature": "Vector2.scaleTo(final double newLength)", "constructo...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_29
{ "fields": [ { "declarator": "ACCURACY = 1e-3", "modifier": "private static final", "original_string": "private static final double ACCURACY = 1e-3;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/circle/Circ...
{ "body": "@Test\n\tpublic void testHullCircleRandomPoints()\n\t{\n\t\tRandom rnd = new Random(42);\n\t\t\n\t\tlong iterations = 1000;\n\t\tfor (int i = 0; i < iterations; i++)\n\t\t{\n\t\t\tint n = 2 + rnd.nextInt(10);\n\t\t\tList<IVector2> points = new ArrayList<>();\n\t\t\tfor (int j = 0; j < n; j++)\n\t\t\t{\n\t\...
{ "fields": [ { "declarator": "center", "modifier": "private final", "original_string": "private final Vector2f center;", "type": "Vector2f", "var_name": "center" }, { "declarator": "radius", "modifier": "private final", "original_string": "private final dou...
{ "body": "public static Optional<ICircle> hullCircle(final List<IVector2> points)\n\t{\n\t\treturn Streams\n\t\t\t\t.concat(StreamUtil.nonRepeatingPermutation2Fold(points), StreamUtil.nonRepeatingPermutation3Fold(points))\n\t\t\t\t.map(Circle::fromNPoints)\n\t\t\t\t.filter(Optional::isPresent)\n\t\t\t\t.map(Optional...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_225
{ "fields": [ { "declarator": "ACCURACY = 1e-6", "modifier": "public static final", "original_string": "public static final double ACCURACY = 1e-6;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/angle/AngleTe...
{ "body": "@Test\n\tpublic void add()\n\t{\n\t\tassertEquals(0, Angle.zero().add(Math.PI / 2).add(Angle.ofDeg(270)).asRad(), ACCURACY);\n\t\tassertEquals(3, Angle.zero().add(Angle.ofDeg(1)).add(Angle.ofDeg(2)).asDeg(), ACCURACY);\n\t}", "class_method_signature": "AngleTest.add()", "constructor": false, "full_si...
{ "fields": [ { "declarator": "ZERO_ANGLE = new Angle()", "modifier": "private static final", "original_string": "private static final Angle ZERO_ANGLE = new Angle();", "type": "Angle", "var_name": "ZERO_ANGLE" } ], "file": "modules/common-math/src/main/java/edu/tigers/sumatr...
{ "body": "@Override\n\tpublic IAngle add(final IAngularMeasure angle)\n\t{\n\t\treturn add(angle.asRad());\n\t}", "class_method_signature": "Angle.add(final IAngularMeasure angle)", "constructor": false, "full_signature": "@Override public IAngle add(final IAngularMeasure angle)", "identifier": "add", "inv...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_9
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/circle/CircleMathTest.java", "identifier": "CircleMathTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void lineIntersectionsCircle()\n\t{\n\t\tICircle circle = Circle.createCircle(Vector2.fromXY(-300, 200), 100);\n\t\tILine line;\n\t\t\n\t\tline = Lines.lineFromPoints(Vector2.fromXY(400, 400), Vector2.fromXY(0, 300));\n\t\tAssertions.assertThat(CircleMath.lineIntersections(circle, line))\n\...
{ "fields": [], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/circle/CircleMath.java", "identifier": "CircleMath", "interfaces": "", "methods": [ { "class_method_signature": "CircleMath.CircleMath()", "constructor": true, "full_signature": "@SuppressWarnings(\"unused...
{ "body": "public static List<IVector2> lineIntersections(final ICircular circle, final ILineBase line)\n\t{\n\t\treturn lineIntersectionsInternal(circle, line.toLine())\n\t\t\t\t.stream()\n\t\t\t\t.filter(line::isPointOnLine)\n\t\t\t\t.collect(Collectors.toList());\n\t}", "class_method_signature": "CircleMath.line...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_51
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/quadrilateral/QuadrilateralTest.java", "identifier": "QuadrilateralTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void isPointInShape() throws Exception\n\t{\n\t\tList<IVector2> acorners = new ArrayList<>(4);\n\t\t\n\t\tacorners.add(Vector2.fromXY(1, -1));\n\t\tacorners.add(Vector2.fromXY(-1, 1));\n\t\tacorners.add(Vector2.fromXY(1, 1));\n\t\tacorners.add(Vector2.fromXY(-1, -1));\n\t\t\n\t\tfor (List<I...
{ "fields": [ { "declarator": "corners = new ArrayList<>(4)", "modifier": "private final", "original_string": "private final List<IVector2> corners = new ArrayList<>(4);", "type": "List<IVector2>", "var_name": "corners" } ], "file": "modules/common-math/src/main/java/edu/tige...
{ "body": "public static IQuadrilateral fromCorners(final IVector2 a, final IVector2 b, final IVector2 c, final IVector2 d)\n\t{\n\t\tValidate.notNull(a);\n\t\tValidate.notNull(b);\n\t\tValidate.notNull(c);\n\t\tValidate.notNull(d);\n\t\tList<IVector2> corners = new ArrayList<>(4);\n\t\tcorners.add(a);\n\t\tcorners.a...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_174
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/line/v2/LinesTest.java", "identifier": "LinesTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testLineFromPoints()\n\t{\n\t\tIVector2 a = Vector2.fromXY(1, 2);\n\t\tIVector2 b = Vector2.fromXY(6, 3);\n\t\t\n\t\tILine lineA = Line.fromPoints(a, b);\n\t\tILine lineB = Lines.lineFromPoints(a, b);\n\t\tassertThat(lineA, is(lineB));\n\t}", "class_method_signature": "LinesTest.test...
{ "fields": [], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/line/v2/Lines.java", "identifier": "Lines", "interfaces": "", "methods": [ { "class_method_signature": "Lines.Lines()", "constructor": true, "full_signature": "private Lines()", "identifier": "Lines...
{ "body": "public static ILine lineFromPoints(final IVector2 supportPointA, final IVector2 supportPointB)\n\t{\n\t\treturn Line.fromPoints(supportPointA, supportPointB);\n\t}", "class_method_signature": "Lines.lineFromPoints(final IVector2 supportPointA, final IVector2 supportPointB)", "constructor": false, "fu...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_123
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testEquals()\n\t{\n\t\tVector3 vec1 = Vector3.fromXYZ(5, 0, -2);\n\t\tVector3 vec2 = Vector3.fromXYZ(5, 0, -2);\n\t\tBoolean result = vec1.equals(vec2);\n\t\tassertTrue(result);\n\t\t\n\t\tvec1 = Vector3.fromXYZ(3.1f, 1.4, -0.1);\n\t\tvec2 = Vector3.fromXYZ(3.1f, 1.4, -0.1);\n\t\tresul...
{ "fields": [ { "declarator": "x", "modifier": "private", "original_string": "private double\tx;", "type": "double", "var_name": "x" }, { "declarator": "y", "modifier": "private", "original_string": "private double\ty;", "type": "double", "var_na...
{ "body": "public static Vector3 fromXYZ(final double x, final double y, final double z)\n\t{\n\t\treturn new Vector3(x, y, z);\n\t}", "class_method_signature": "Vector3.fromXYZ(final double x, final double y, final double z)", "constructor": false, "full_signature": "public static Vector3 fromXYZ(final double ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_10
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/circle/CircleMathTest.java", "identifier": "CircleMathTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void lineSegmentIntersections()\n\t{\n\t\tICircle circle = Circle.createCircle(Vector2.fromXY(200, -200), 100);\n\t\tILineSegment line;\n\t\t\n\t\tline = Lines.segmentFromPoints(Vector2.fromXY(0, 0), Vector2.fromXY(200, -200));\n\t\tAssertions.assertThat(CircleMath.lineIntersections(circle,...
{ "fields": [], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/circle/CircleMath.java", "identifier": "CircleMath", "interfaces": "", "methods": [ { "class_method_signature": "CircleMath.CircleMath()", "constructor": true, "full_signature": "@SuppressWarnings(\"unused...
{ "body": "public static List<IVector2> lineIntersections(final ICircular circle, final ILineBase line)\n\t{\n\t\treturn lineIntersectionsInternal(circle, line.toLine())\n\t\t\t\t.stream()\n\t\t\t\t.filter(line::isPointOnLine)\n\t\t\t\t.collect(Collectors.toList());\n\t}", "class_method_signature": "CircleMath.line...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_135
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testFrom2d()\n\t{\n\t\tassertThat(Vector3.from2d(Vector2.fromXY(42, 1337), 3.14)).isEqualTo(Vector3.fromXYZ(42, 1337, 3.14));\n\t}", "class_method_signature": "Vector3Test.testFrom2d()", "constructor": false, "full_signature": "@Test public void testFrom2d()", "identifier": "te...
{ "fields": [ { "declarator": "x", "modifier": "private", "original_string": "private double\tx;", "type": "double", "var_name": "x" }, { "declarator": "y", "modifier": "private", "original_string": "private double\ty;", "type": "double", "var_na...
{ "body": "public static Vector3 from2d(final IVector2 xy, final double z)\n\t{\n\t\treturn new Vector3(xy.x(), xy.y(), z);\n\t}", "class_method_signature": "Vector3.from2d(final IVector2 xy, final double z)", "constructor": false, "full_signature": "public static Vector3 from2d(final IVector2 xy, final double ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_162
{ "fields": [ { "declarator": "lineConstructor = dV -> HalfLine.fromDirection(Vector2f.ZERO_VECTOR, dV)", "modifier": "private final static", "original_string": "private final static LineConstructor lineConstructor = dV -> HalfLine.fromDirection(Vector2f.ZERO_VECTOR, dV);", "type": "LineCo...
{ "body": "@Test\n\tpublic void testClosestPointOnLine()\n\t{\n\t\tIVector2 point = Vector2f.fromXY(0, 0);\n\t\t\n\t\tIVector2 lineSV = Vector2f.fromXY(1, 0);\n\t\tfor (int degAngle = 0; degAngle <= 360; degAngle++)\n\t\t{\n\t\t\tdouble radAngle = Math.toRadians(degAngle);\n\t\t\t\n\t\t\tIVector2 lineDV = Vector2.fro...
{ "fields": [], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/line/v2/HalfLine.java", "identifier": "HalfLine", "interfaces": "implements IHalfLine", "methods": [ { "class_method_signature": "HalfLine.HalfLine(final IVector2 supportVector, final IVector2 directionVector)", ...
{ "body": "@Override\n\tpublic IVector2 closestPointOnLine(final IVector2 point)\n\t{\n\t\tif (!isValid())\n\t\t{\n\t\t\treturn supportVector();\n\t\t}\n\t\treturn LineMath.closestPointOnHalfLine(this, point);\n\t}", "class_method_signature": "HalfLine.closestPointOnLine(final IVector2 point)", "constructor": fal...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_47
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/rectangle/RectangleTest.java", "identifier": "RectangleTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testGetEdgesAsSegments()\n\t{\n\t\tRectangle rect = Rectangle.fromCenter(Vector2.zero(), 42, 42);\n\t\t\n\t\t// Starting at topLeft, going counter clockwise.\n\t\tList<ILineSegment> edges = rect.getEdgesAsSegments();\n\t\tassertThat(edges.stream().map(ILineSegment::getStart))\n\t\t\t\t...
{ "fields": [ { "declarator": "center", "modifier": "private final", "original_string": "private final Vector2f center;", "type": "Vector2f", "var_name": "center" }, { "declarator": "xExtent", "modifier": "private final", "original_string": "private final do...
{ "body": "public static Rectangle fromCenter(final IVector2 center, final double xExtent, final double yExtent)\n\t{\n\t\treturn new Rectangle(center, xExtent, yExtent);\n\t}", "class_method_signature": "Rectangle.fromCenter(final IVector2 center, final double xExtent, final double yExtent)", "constructor": fals...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_119
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testMultiply()\n\t{\n\t\tVector3 vec1 = Vector3.fromXYZ(4, 7, -2);\n\t\tdouble factor = 4.5;\n\t\tvec1.multiply(factor);\n\t\tassertEquals(Vector3.fromXYZ(18, 31.5, -9), vec1);\n\t\t\n\t\tvec1 = Vector3.fromXYZ(1, 1, 1);\n\t\tfactor = AngleMath.PI;\n\t\tvec1.multiply(factor);\n\t\tasse...
{ "fields": [ { "declarator": "x", "modifier": "private", "original_string": "private double\tx;", "type": "double", "var_name": "x" }, { "declarator": "y", "modifier": "private", "original_string": "private double\ty;", "type": "double", "var_na...
{ "body": "public Vector3 multiply(final double f)\n\t{\n\t\tx *= f;\n\t\ty *= f;\n\t\tz *= f;\n\t\t\n\t\treturn this;\n\t}", "class_method_signature": "Vector3.multiply(final double f)", "constructor": false, "full_signature": "public Vector3 multiply(final double f)", "identifier": "multiply", "invocation...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_230
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/StatisticsMathTest.java", "identifier": "StatisticsMathTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testMean()\n\t{\n\t\tAssertions.assertThat(StatisticsMath.mean(Arrays.asList(1))).isEqualTo(1);\n\t\tAssertions.assertThat(StatisticsMath.mean(Arrays.asList(1, 1))).isEqualTo(1);\n\t\tAssertions.assertThat(StatisticsMath.mean(Arrays.asList(1, 1, 1))).isEqualTo(1);\n\t\tAssertions.asser...
{ "fields": [], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/StatisticsMath.java", "identifier": "StatisticsMath", "interfaces": "", "methods": [ { "class_method_signature": "StatisticsMath.StatisticsMath()", "constructor": true, "full_signature": "@SuppressWarnings...
{ "body": "public static <T extends Number> double mean(final List<T> values)\n\t{\n\t\tdouble sum = 0;\n\t\tfor (Number f : values)\n\t\t{\n\t\t\tsum += f.doubleValue();\n\t\t}\n\t\treturn sum / values.size();\n\t}", "class_method_signature": "StatisticsMath.mean(final List<T> values)", "constructor": false, "...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_84
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testGetXYZVector()\n\t{\n\t\tVectorN vector = VectorN.from(42, 1337, 3.14);\n\t\tassertThat(vector.getXYZVector()).isEqualTo(Vector3.fromXYZ(42, 1337, 3.14));\n\t}", "class_method_signature": "VectorNTest.testGetXYZVector()", "constructor": false, "full_signature": "@Test public ...
{ "fields": [ { "declarator": "data", "modifier": "private", "original_string": "private double[] data;", "type": "double[]", "var_name": "data" } ], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/vector/VectorN.java", "identifier": "VectorN", "interfa...
{ "body": "public static VectorN from(final double... data)\n\t{\n\t\tif (data == null)\n\t\t{\n\t\t\treturn VectorN.empty();\n\t\t}\n\t\treturn new VectorN(data);\n\t}", "class_method_signature": "VectorN.from(final double... data)", "constructor": false, "full_signature": "public static VectorN from(final dou...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_158
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/SumatraMathTest.java", "identifier": "SumatraMathTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testCubicFunctionRoots()\n\t{\n\t\t// Note: truth values calculated by wxMaxima\n\t\t\n\t\tList<Double> roots;\n\t\t\n\t\t// test quadratic function\n\t\troots = SumatraMath.cubicFunctionRoots(0, 1, 6, 5);\n\t\tAssert.assertTrue(roots.size() == 2);\n\t\tAssert.assertEquals(-1.0, roots....
{ "fields": [ { "declarator": "EQUAL_TOL = 1e-3", "modifier": "private static final", "original_string": "private static final double EQUAL_TOL = 1e-3;", "type": "double", "var_name": "EQUAL_TOL" } ], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/SumatraM...
{ "body": "public static List<Double> cubicFunctionRoots(final double a3, final double b2, final double c1, final double d0)\n\t{\n\t\t// Verify preconditions.\n\t\tif (isEqual(a3, 0.0))\n\t\t{\n\t\t\treturn quadraticFunctionRoots(b2, c1, d0);\n\t\t}\n\t\t\n\t\tList<Double> roots = new ArrayList<>();\n\t\t\n\t\t// no...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_92
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testTurn()\n\t{\n\t\tVector2 vec1 = Vector2.fromXY(1, 0);\n\t\tvec1.turn(AngleMath.PI);\n\t\tassertEquals(vec1.x(), -1, ACCURACY);\n\t\tassertEquals(vec1.y(), 0, ACCURACY);\n\t\t\n\t\tvec1 = Vector2.fromXY(1, 0);\n\t\tvec1.turn(AngleMath.PI * (1.5f));\n\t\tassertEquals(vec1.x(), 0, ACC...
{ "fields": [ { "declarator": "x", "modifier": "private", "original_string": "private double x;", "type": "double", "var_name": "x" }, { "declarator": "y", "modifier": "private", "original_string": "private double y;", "type": "double", "var_name...
{ "body": "public Vector2 turn(final double angle)\n\t{\n\t\tfinal double cosA = SumatraMath.cos(angle);\n\t\tfinal double sinA = SumatraMath.sin(angle);\n\t\t\n\t\tfinal double x2 = (x() * cosA) - (y() * sinA);\n\t\tfinal double y2 = (y() * cosA) + (x() * sinA);\n\t\t\n\t\tsetX(x2);\n\t\tsetY(y2);\n\t\t\n\t\treturn ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_226
{ "fields": [ { "declarator": "ACCURACY = 1e-6", "modifier": "public static final", "original_string": "public static final double ACCURACY = 1e-6;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/angle/AngleTe...
{ "body": "@Test\n\tpublic void subtract()\n\t{\n\t\tassertEquals(0, Angle.zero().subtract(Math.PI / 2).subtract(Angle.ofDeg(270)).asRad(), ACCURACY);\n\t\tassertEquals(-3, Angle.zero().subtract(Angle.ofDeg(1)).subtract(Angle.ofDeg(2)).asDeg(), ACCURACY);\n\t}", "class_method_signature": "AngleTest.subtract()", "...
{ "fields": [ { "declarator": "ZERO_ANGLE = new Angle()", "modifier": "private static final", "original_string": "private static final Angle ZERO_ANGLE = new Angle();", "type": "Angle", "var_name": "ZERO_ANGLE" } ], "file": "modules/common-math/src/main/java/edu/tigers/sumatr...
{ "body": "@Override\n\tpublic IAngle subtract(final IAngularMeasure angle)\n\t{\n\t\treturn subtract(angle.asRad());\n\t}", "class_method_signature": "Angle.subtract(final IAngularMeasure angle)", "constructor": false, "full_signature": "@Override public IAngle subtract(final IAngularMeasure angle)", "identi...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_251
{ "fields": [], "file": "modules/sumatra-snapshot/src/test/java/edu/tigers/sumatra/snapshot/SnapshotTest.java", "identifier": "SnapshotTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testFromJSON() throws ParseException\n\t{\n\t\tJSONParser parser = new JSONParser();\n\t\tSnapshot snapshot = new Snapshot(new HashMap<>(), new SnapObject(Vector3.zero(), Vector3.zero()));\n\t\tassertEquals(snapshot,\n\t\t\t\tSnapshot.fromJSON(\n\t\t\t\t\t\t(JSONObject) parser.parse(\"...
{ "fields": [ { "declarator": "bots", "modifier": "private", "original_string": "private Map<BotID, SnapObject> bots;", "type": "Map<BotID, SnapObject>", "var_name": "bots" }, { "declarator": "ball", "modifier": "private", "original_string": "private SnapObj...
{ "body": "public static Snapshot fromJSON(final JSONObject obj)\n\t{\n\t\tMap<BotID, SnapObject> bots = botsFromJSON((JSONArray) obj.get(\"bots\"));\n\t\tSnapObject ball = SnapObject.fromJSON((JSONObject) obj.get(\"ball\"));\n\t\treturn new Snapshot(bots, ball);\n\t}", "class_method_signature": "Snapshot.fromJSON(...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_197
{ "fields": [ { "declarator": "lineConstructor = dV -> Line.fromDirection(Vector2f.ZERO_VECTOR, dV)", "modifier": "private final static", "original_string": "private final static LineConstructor lineConstructor = dV -> Line.fromDirection(Vector2f.ZERO_VECTOR, dV);", "type": "LineConstructo...
{ "body": "@Test\n\tpublic void testIsPointOnLine()\n\t{\n\t\tILine line = Line.fromDirection(Vector2f.ZERO_VECTOR, Vector2.fromXY(3, 0));\n\t\t\n\t\tIVector2 point = Vector2.fromXY(Double.MIN_VALUE / 2.0d, 0);\n\t\tassertThat(line.isPointOnLine(point), is(true));\n\t\t\n\t\tpoint = Vector2.fromXY(-ALine.LINE_MARGIN ...
{ "fields": [], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/line/v2/Line.java", "identifier": "Line", "interfaces": "implements ILine", "methods": [ { "class_method_signature": "Line.Line(final IVector2 supportVector, final IVector2 directionVector)", "constructor": true...
{ "body": "public static ILine fromDirection(final IVector2 supportVector, final IVector2 directionVector)\n\t{\n\t\treturn createNewFromVectorCopy(supportVector, directionVector);\n\t}", "class_method_signature": "Line.fromDirection(final IVector2 supportVector, final IVector2 directionVector)", "constructor": f...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_178
{ "fields": [ { "declarator": "lineConstructor = dV -> LineSegment.fromPoints(Vector2f.ZERO_VECTOR,\n\t\t\tVector2f.ZERO_VECTOR.addNew(dV))", "modifier": "private final static", "original_string": "private final static LineConstructor lineConstructor = dV -> LineSegment.fromPoints(Vector2f.ZERO_...
{ "body": "@Test\n\tpublic void testEquals()\n\t{\n\t\tIVector2 a = Vector2.fromXY(10, 20);\n\t\tIVector2 b = Vector2.fromXY(30, 40);\n\t\tIVector2 c = Vector2.fromXY(80, 100);\n\t\t\n\t\tILineSegment segmentA = LineSegment.fromPoints(a, b);\n\t\tILineSegment segmentB = LineSegment.fromPoints(a, b);\n\t\tassertThat(s...
{ "fields": [ { "declarator": "start", "modifier": "private final", "original_string": "private final Vector2f start;", "type": "Vector2f", "var_name": "start" }, { "declarator": "end", "modifier": "private final", "original_string": "private final Vector2f ...
{ "body": "@Override\n\tpublic final boolean equals(final Object other)\n\t{\n\t\tif (this == other)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\tif (!(other instanceof ILineSegment))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tfinal ILineSegment that = (ILineSegment) other;\n\t\t\n\t\treturn getStart().equals(that.getSt...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_5
{ "fields": [ { "declarator": "params", "modifier": "private", "original_string": "private FixedLossPlusRollingParameters params;", "type": "FixedLossPlusRollingParameters", "var_name": "params" }, { "declarator": "consultant", "modifier": "private", "origin...
{ "body": "@Test\n\tpublic void testGetMaximumDistanceToOverChip()\n\t{\n\t\t// test specific values\n\t\tdouble dist = consultant.getMaximumDistanceToOverChip(3.0, 150);\n\t\tassertEquals(dist, 728.5402049514264, 1e-6);\n\t\t\n\t\t// test unreachable height\n\t\tdist = consultant.getMaximumDistanceToOverChip(1.0, 10...
{ "fields": [ { "declarator": "chipAngle = AngleMath.deg2rad(45)", "modifier": "private", "original_string": "private double chipAngle = AngleMath.deg2rad(45);", "type": "double", "var_name": "chipAngle" }, { "declarator": "params", "modifier": "private final", ...
{ "body": "@Override\n\tpublic double getMaximumDistanceToOverChip(final double initVel, final double height)\n\t{\n\t\tfinal double g = 9.81;\n\t\tdouble heightInM = height * 0.001;\n\t\tIVector2 kickVel = absoluteKickVelToVector(initVel);\n\t\tdouble velZ = kickVel.y();\n\t\t\n\t\t// maximum height at parabola peak...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_206
{ "fields": [ { "declarator": "random", "modifier": "private", "original_string": "private Random random;", "type": "Random", "var_name": "random" }, { "declarator": "TEST_ACCURACY = 1e-3", "modifier": "private static final", "original_string": "private stat...
{ "body": "@Test\n\tpublic void testNearestPointOnLineSegment()\n\t{\n\t\tfinal IVector2 l1p1 = Vector2.fromXY(-0.8, 0);\n\t\tfinal IVector2 l1p2 = Vector2.fromXY(0.8, 0);\n\n\t\tfor (double i = 0; i < 10; i += 0.001)\n\t\t{\n\t\t\tfinal IVector2 point = Vector2.fromXY(SumatraMath.cos(i), SumatraMath.sin(i));\n\t\t\t...
{ "fields": [ { "declarator": "ACCURACY = SumatraMath.getEqualTol()", "modifier": "private static final", "original_string": "private static final double ACCURACY = SumatraMath.getEqualTol();", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/mai...
{ "body": "public static Vector2 nearestPointOnLineSegment(final ILine line, final IVector2 point)\n\t{\n\t\tfinal double lambda = getLeadPointLambda(point, line);\n\t\tif (isLambdaInRange(lambda, 0, 1))\n\t\t{\n\t\t\treturn getPointOnLineForLambda(line, lambda);\n\t\t}\n\t\tfinal double dist1 = VectorMath.distancePP...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_210
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/line/LineTest.java", "identifier": "LineTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testIsPointInFront()\n\t{\n\t\tILine line = Line.fromDirection(Vector2.fromXY(42, 1337), Vector2.fromX(1));\n\t\tassertThat(line.isPointInFront(Vector2.fromXY(42, 1337)), is(true));\n\t\tassertThat(line.isPointInFront(Vector2.fromXY(42.1, 1337)), is(true));\n\t\tassertThat(line.isPoint...
{ "fields": [ { "declarator": "supportVector", "modifier": "private final", "original_string": "private final IVector2 supportVector;", "type": "IVector2", "var_name": "supportVector" }, { "declarator": "directionVector", "modifier": "private final", "origin...
{ "body": "public static Line fromDirection(final IVector2 supportVector, final IVector2 directionVector)\n\t{\n\t\treturn new Line(supportVector, directionVector);\n\t}", "class_method_signature": "Line.fromDirection(final IVector2 supportVector, final IVector2 directionVector)", "constructor": false, "full_si...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_139
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Vector3fTest.java", "identifier": "Vector3fTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testEquals()\n\t{\n\t\tEqualsVerifier.forClass(Vector3f.class)\n\t\t\t\t.suppress(Warning.NONFINAL_FIELDS)\n\t\t\t\t.verify();\n\t\t\n\t\tassertThat(Vector3.fromXYZ(42, 1337, 3.14)).isEqualTo(Vector3f.fromXYZ(42, 1337, 3.14));\n\t\t\n\t}", "class_method_signature": "Vector3fTest.test...
{ "fields": [ { "declarator": "X_AXIS = fromXYZ(1, 0, 0)", "modifier": "public static final", "original_string": "public static final Vector3f X_AXIS = fromXYZ(1, 0, 0);", "type": "Vector3f", "var_name": "X_AXIS" }, { "declarator": "Y_AXIS = fromXYZ(0, 1, 0)", "mo...
{ "body": "public static Vector3f fromXYZ(final double x, final double y, final double z)\n\t{\n\t\treturn new Vector3f(x, y, z);\n\t}", "class_method_signature": "Vector3f.fromXYZ(final double x, final double y, final double z)", "constructor": false, "full_signature": "public static Vector3f fromXYZ(final dou...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_247
{ "fields": [ { "declarator": "depth = 400", "modifier": "private", "original_string": "private double depth = 400;", "type": "double", "var_name": "depth" }, { "declarator": "length = 800", "modifier": "private", "original_string": "private double length = ...
{ "body": "@Test\n\tpublic void testIntersectionArea()\n\t{\n\t\t// cut half way\n\t\tassertThat(penaltyArea.intersectionArea(\n\t\t\t\tVector2.fromXY(goalX + depth / 2, -length / 2),\n\t\t\t\tVector2.fromXY(goalX + depth / 2, length / 2)))\n\t\t\t\t\t\t.isCloseTo(depth / 2 * length * 1e-6, within(1e-6));\n\t\t// int...
{ "fields": [ { "declarator": "goalCenterX", "modifier": "private final", "original_string": "private final double goalCenterX;", "type": "double", "var_name": "goalCenterX" }, { "declarator": "length", "modifier": "private final", "original_string": "privat...
{ "body": "@Override\n\tpublic double intersectionArea(final IVector2 from, final IVector2 to)\n\t{\n\t\tif (isBehindPenaltyArea(from) || isBehindPenaltyArea(to))\n\t\t{\n\t\t\treturn depth * length * 1e-6;\n\t\t}\n\n\t\tILineSegment line = Lines.segmentFromPoints(\n\t\t\t\trectangle.nearestPointOutside(from), rectan...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_181
{ "fields": [ { "declarator": "lineConstructor = dV -> LineSegment.fromPoints(Vector2f.ZERO_VECTOR,\n\t\t\tVector2f.ZERO_VECTOR.addNew(dV))", "modifier": "private final static", "original_string": "private final static LineConstructor lineConstructor = dV -> LineSegment.fromPoints(Vector2f.ZERO_...
{ "body": "@Test\n\tpublic void testToLine()\n\t{\n\t\tIVector2 start = Vector2.fromXY(10, 20);\n\t\tIVector2 end = Vector2.fromXY(30, 40);\n\t\t\n\t\tILineSegment segment = LineSegment.fromPoints(start, end);\n\t\tILine line = segment.toLine();\n\t\t\n\t\tassertThat(line.supportVector(), is(segment.getStart()));\n\t...
{ "fields": [ { "declarator": "start", "modifier": "private final", "original_string": "private final Vector2f start;", "type": "Vector2f", "var_name": "start" }, { "declarator": "end", "modifier": "private final", "original_string": "private final Vector2f ...
{ "body": "@Override\n\tpublic ILine toLine()\n\t{\n\t\treturn Line.createNewWithoutCopy(getStart(), directionVector());\n\t}", "class_method_signature": "LineSegment.toLine()", "constructor": false, "full_signature": "@Override public ILine toLine()", "identifier": "toLine", "invocations": [ "createNew...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_30
{ "fields": [ { "declarator": "startCenter = Vector2.zero()", "modifier": "private", "original_string": "private IVector2 startCenter = Vector2.zero();", "type": "IVector2", "var_name": "startCenter" }, { "declarator": "endCenter = Vector2.fromXY(1000, 0)", "modif...
{ "body": "@Test\n\tpublic void testIsPointInShape()\n\t{\n\t\tITube tube = Tube.create(startCenter, endCenter, radius);\n\t\tITube tubeZeroLength = Tube.create(startCenter, startCenter, radius);\n\t\t\n\t\tAssert.assertTrue(tube.isPointInShape(startCenter));\n\t\tAssert.assertTrue(tube.isPointInShape(endCenter));\n\...
{ "fields": [ { "declarator": "startCenter", "modifier": "private final", "original_string": "private final IVector2 startCenter;", "type": "IVector2", "var_name": "startCenter" }, { "declarator": "endCenter", "modifier": "private final", "original_string": ...
{ "body": "@Override\n\tpublic boolean isPointInShape(final IVector2 point)\n\t{\n\t\tILineSegment line = Lines.segmentFromPoints(startCenter, endCenter);\n\t\treturn line.distanceTo(point) < radius;\n\t}", "class_method_signature": "Tube.isPointInShape(final IVector2 point)", "constructor": false, "full_signat...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_115
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/VectorMathTest.java", "identifier": "VectorMathTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testFarthestPointInList()\n\t{\n\t\tRandom rnd = new Random(239827);\n\t\tfor (int times = 0; times < 1e5; ++times)\n\t\t{\n\t\t\tList<IVector2> c = new ArrayList<>();\n\t\t\tfor (int i = rnd.nextInt(50) + 1; i > 0; --i)\n\t\t\t{\n\t\t\t\tdouble length = rnd.nextDouble() * 1000;\n\t\t\...
{ "fields": [], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/vector/VectorMath.java", "identifier": "VectorMath", "interfaces": "", "methods": [ { "class_method_signature": "VectorMath.VectorMath()", "constructor": true, "full_signature": "@SuppressWarnings(\"unused...
{ "body": "static IVector2 farthestTo(final IVector2 p, final Collection<IVector2> points)\n\t{\n\t\tValidate.notEmpty(points);\n\t\tIVector2 farthest = null;\n\t\tdouble farthestDist = Double.MIN_VALUE;\n\t\tfor (IVector2 vec : points)\n\t\t{\n\t\t\tdouble dist = distancePPSqr(vec, p);\n\t\t\tif (farthestDist < dist...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_142
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Vector3fTest.java", "identifier": "Vector3fTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testCopy()\n\t{\n\t\tassertThat(Vector3f.copy(Vector3.fromXYZ(42, 1337, 3.14))).isEqualTo(Vector3.fromXYZ(42, 1337, 3.14));\n\t\tassertThat(Vector3f.copy(Vector3.fromXYZ(42, 42, 3.14))).isNotEqualTo(Vector3.fromXYZ(42, 1337, 3.14));\n\t}", "class_method_signature": "Vector3fTest.test...
{ "fields": [ { "declarator": "X_AXIS = fromXYZ(1, 0, 0)", "modifier": "public static final", "original_string": "public static final Vector3f X_AXIS = fromXYZ(1, 0, 0);", "type": "Vector3f", "var_name": "X_AXIS" }, { "declarator": "Y_AXIS = fromXYZ(0, 1, 0)", "mo...
{ "body": "public static Vector3f copy(final IVector3 original)\n\t{\n\t\tif (original.getNumDimensions() == 2)\n\t\t{\n\t\t\treturn new Vector3f(original.x(), original.y(), 0);\n\t\t}\n\t\treturn new Vector3f(original.x(), original.y(), original.z());\n\t}", "class_method_signature": "Vector3f.copy(final IVector3 ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_67
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testMultiply()\n\t{\n\t\tVectorN vec1 = VectorN.from(4, 7, -2);\n\t\tdouble factor = 4.5;\n\t\tvec1.multiply(factor);\n\t\tassertEquals(VectorN.from(18, 31.5, -9), vec1);\n\t\t\n\t\tvec1 = VectorN.from(1, 1, 1);\n\t\tfactor = AngleMath.PI;\n\t\tvec1.multiply(factor);\n\t\tassertEquals(...
{ "fields": [ { "declarator": "data", "modifier": "private", "original_string": "private double[] data;", "type": "double[]", "var_name": "data" } ], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/vector/VectorN.java", "identifier": "VectorN", "interfa...
{ "body": "public VectorN multiply(final double factor)\n\t{\n\t\tfor (int i = 0; i < getNumDimensions(); i++)\n\t\t{\n\t\t\tdata[i] *= factor;\n\t\t}\n\t\treturn this;\n\t}", "class_method_signature": "VectorN.multiply(final double factor)", "constructor": false, "full_signature": "public VectorN multiply(fina...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_88
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testMultiply()\n\t{\n\t\tVector2 vec1 = Vector2.fromXY(4, 7);\n\t\tdouble factor = 4.5;\n\t\tvec1.multiply(factor);\n\t\tassertEquals(Vector2.fromXY(18, 31.5), vec1);\n\t\t\n\t\tvec1 = Vector2.fromXY(1, 1);\n\t\tfactor = AngleMath.PI;\n\t\tvec1.multiply(factor);\n\t\tassertEquals(vec1....
{ "fields": [ { "declarator": "x", "modifier": "private", "original_string": "private double x;", "type": "double", "var_name": "x" }, { "declarator": "y", "modifier": "private", "original_string": "private double y;", "type": "double", "var_name...
{ "body": "public Vector2 multiply(final double factor)\n\t{\n\t\tsetX(x() * factor);\n\t\tsetY(y() * factor);\n\t\treturn this;\n\t}", "class_method_signature": "Vector2.multiply(final double factor)", "constructor": false, "full_signature": "public Vector2 multiply(final double factor)", "identifier": "mult...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_71
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testEquals()\n\t{\n\t\tVectorN vec1 = VectorN.from(5, 0, -2);\n\t\tVectorN vec2 = VectorN.from(5, 0, -2);\n\t\tBoolean result = vec1.equals(vec2);\n\t\tassertTrue(result);\n\t\t\n\t\tvec1 = VectorN.from(3.1f, 1.4, -0.1);\n\t\tvec2 = VectorN.from(3.1f, 1.4, -0.1);\n\t\tresult = vec1.equ...
{ "fields": [ { "declarator": "data", "modifier": "private", "original_string": "private double[] data;", "type": "double[]", "var_name": "data" } ], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/vector/VectorN.java", "identifier": "VectorN", "interfa...
{ "body": "public static VectorN from(final double... data)\n\t{\n\t\tif (data == null)\n\t\t{\n\t\t\treturn VectorN.empty();\n\t\t}\n\t\treturn new VectorN(data);\n\t}", "class_method_signature": "VectorN.from(final double... data)", "constructor": false, "full_signature": "public static VectorN from(final dou...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_154
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/SumatraMathTest.java", "identifier": "SumatraMathTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testMax()\n\t{\n\t\tAssertions.assertThat(SumatraMath.max(1)).isEqualTo(1.0);\n\t\tAssertions.assertThat(SumatraMath.max(1, 2)).isEqualTo(2.0);\n\t\tAssertions.assertThat(SumatraMath.max(1, 2, 3)).isEqualTo(3.0);\n\t\tAssertions.assertThat(SumatraMath.max(3, 2, 1)).isEqualTo(3.0);\n\t\...
{ "fields": [ { "declarator": "EQUAL_TOL = 1e-3", "modifier": "private static final", "original_string": "private static final double EQUAL_TOL = 1e-3;", "type": "double", "var_name": "EQUAL_TOL" } ], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/SumatraM...
{ "body": "public static double max(final double... values)\n\t{\n\t\tif (values.length == 0)\n\t\t{\n\t\t\tthrow new IllegalArgumentException(\"No values\");\n\t\t}\n\t\t\n\t\tdouble maximum = values[0];\n\t\t\n\t\tfor (final double f : values)\n\t\t{\n\t\t\tif (f > maximum)\n\t\t\t{\n\t\t\t\tmaximum = f;\n\t\t\t}\n...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_103
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testGetSaveableString()\n\t{\n\t\tassertThat(Vector2.fromXY(42, 1337).getSaveableString())\n\t\t\t\t.isEqualTo(42d + \";\" + 1337d);\n\t}", "class_method_signature": "Vector2Test.testGetSaveableString()", "constructor": false, "full_signature": "@Test public void testGetSaveableS...
{ "fields": [ { "declarator": "x", "modifier": "private", "original_string": "private double x;", "type": "double", "var_name": "x" }, { "declarator": "y", "modifier": "private", "original_string": "private double y;", "type": "double", "var_name...
{ "body": "public static Vector2 fromXY(final double x, final double y)\n\t{\n\t\treturn new Vector2(x, y);\n\t}", "class_method_signature": "Vector2.fromXY(final double x, final double y)", "constructor": false, "full_signature": "public static Vector2 fromXY(final double x, final double y)", "identifier": "...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_26
{ "fields": [ { "declarator": "ACCURACY = 1e-3", "modifier": "private static final", "original_string": "private static final double ACCURACY = 1e-3;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/circle/Circ...
{ "body": "@Test\n\tpublic void testTangentialIntersections()\n\t{\n\t\tICircle circle = Circle.createCircle(Vector2.fromXY(5, 7), 6);\n\t\tIVector2 externalPoint = Vector2.fromXY(1, 1);\n\t\tList<IVector2> res = circle.tangentialIntersections(externalPoint);\n\t\tfor (IVector2 p : res)\n\t\t{\n\t\t\tif (p.isCloseTo(...
{ "fields": [ { "declarator": "center", "modifier": "private final", "original_string": "private final Vector2f center;", "type": "Vector2f", "var_name": "center" }, { "declarator": "radius", "modifier": "private final", "original_string": "private final dou...
{ "body": "public static ICircle createCircle(final IVector2 center, final double radius)\n\t{\n\t\treturn new Circle(center, radius);\n\t}", "class_method_signature": "Circle.createCircle(final IVector2 center, final double radius)", "constructor": false, "full_signature": "public static ICircle createCircle(f...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_102
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testIsFinite()\n\t{\n\t\tassertThat(Vector2.fromX(0).isFinite()).isTrue();\n\t\tassertThat(Vector2.fromX(Double.NaN).isFinite()).isFalse();\n\t\tassertThat(Vector2.fromX(Double.POSITIVE_INFINITY).isFinite()).isFalse();\n\t}", "class_method_signature": "Vector2Test.testIsFinite()", ...
{ "fields": [ { "declarator": "x", "modifier": "private", "original_string": "private double x;", "type": "double", "var_name": "x" }, { "declarator": "y", "modifier": "private", "original_string": "private double y;", "type": "double", "var_name...
{ "body": "public static Vector2 fromX(final double x)\n\t{\n\t\treturn fromXY(x, 0);\n\t}", "class_method_signature": "Vector2.fromX(final double x)", "constructor": false, "full_signature": "public static Vector2 fromX(final double x)", "identifier": "fromX", "invocations": [ "fromXY" ], "modifier...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_27
{ "fields": [ { "declarator": "ACCURACY = 1e-3", "modifier": "private static final", "original_string": "private static final double ACCURACY = 1e-3;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/circle/Circ...
{ "body": "@Test\n\tpublic void testInvalidCircleFrom3Points()\n\t{\n\t\tIVector2 P1 = Vector2.fromXY(0, 0);\n\t\tIVector2 P2 = Vector2.fromXY(1, 0);\n\t\tIVector2 P3 = Vector2.fromXY(2, 0);\n\t\t\n\t\tif (Circle.from3Points(P1, P2, P3).isPresent())\n\t\t{\n\t\t\tAssert.fail();\n\t\t}\n\t}", "class_method_signature...
{ "fields": [ { "declarator": "center", "modifier": "private final", "original_string": "private final Vector2f center;", "type": "Vector2f", "var_name": "center" }, { "declarator": "radius", "modifier": "private final", "original_string": "private final dou...
{ "body": "public static Optional<ICircle> from3Points(final IVector2 p1, final IVector2 p2, final IVector2 p3)\n\t{\n\t\treturn fromNPoints(Arrays.asList(p1, p2, p3));\n\t}", "class_method_signature": "Circle.from3Points(final IVector2 p1, final IVector2 p2, final IVector2 p3)", "constructor": false, "full_sig...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_70
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testGetLength()\n\t{\n\t\tassertThat(VectorN.from(42, 0, 0).getLength2()).isEqualTo(42);\n\t\tassertThat(VectorN.from(-42, 0, 0).getLength2()).isEqualTo(42);\n\t\tassertThat(VectorN.from(2, 2, 0).getLength2()).isCloseTo(Math.sqrt(8), within(1e-6));\n\t\tassertThat(VectorN.from(42, -133...
{ "fields": [ { "declarator": "data", "modifier": "private", "original_string": "private double[] data;", "type": "double[]", "var_name": "data" } ], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/vector/VectorN.java", "identifier": "VectorN", "interfa...
{ "body": "public static VectorN from(final double... data)\n\t{\n\t\tif (data == null)\n\t\t{\n\t\t\treturn VectorN.empty();\n\t\t}\n\t\treturn new VectorN(data);\n\t}", "class_method_signature": "VectorN.from(final double... data)", "constructor": false, "full_signature": "public static VectorN from(final dou...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_155
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/SumatraMathTest.java", "identifier": "SumatraMathTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testIsEqual()\n\t{\n\t\tAssertions.assertThat(SumatraMath.isEqual(1, 1)).isTrue();\n\t\tAssertions.assertThat(SumatraMath.isEqual(1, 2)).isFalse();\n\t\t\n\t\tAssertions.assertThat(SumatraMath.isEqual(1, 1, 0)).isTrue();\n\t\tAssertions.assertThat(SumatraMath.isEqual(1, 2, 0)).isFalse(...
{ "fields": [ { "declarator": "EQUAL_TOL = 1e-3", "modifier": "private static final", "original_string": "private static final double EQUAL_TOL = 1e-3;", "type": "double", "var_name": "EQUAL_TOL" } ], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/SumatraM...
{ "body": "public static boolean isEqual(final double a, final double b, final double tolerance)\n\t{\n\t\treturn Math.abs(a - b) <= tolerance;\n\t}", "class_method_signature": "SumatraMath.isEqual(final double a, final double b, final double tolerance)", "constructor": false, "full_signature": "public static b...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_143
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Vector3fTest.java", "identifier": "Vector3fTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testZero()\n\t{\n\t\tVector3f zero = Vector3f.zero();\n\t\tassertThat(zero.x()).isEqualTo(0.0);\n\t\tassertThat(zero.y()).isEqualTo(0.0);\n\t}", "class_method_signature": "Vector3fTest.testZero()", "constructor": false, "full_signature": "@Test public void testZero()", "identif...
{ "fields": [ { "declarator": "X_AXIS = fromXYZ(1, 0, 0)", "modifier": "public static final", "original_string": "public static final Vector3f X_AXIS = fromXYZ(1, 0, 0);", "type": "Vector3f", "var_name": "X_AXIS" }, { "declarator": "Y_AXIS = fromXYZ(0, 1, 0)", "mo...
{ "body": "public static Vector3f zero()\n\t{\n\t\treturn new Vector3f();\n\t}", "class_method_signature": "Vector3f.zero()", "constructor": false, "full_signature": "public static Vector3f zero()", "identifier": "zero", "invocations": [], "modifiers": "public static", "parameters": "()", "return": "V...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_66
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testAddNew()\n\t{\n\t\tVectorN vec1 = VectorN.from(5, 7, 3);\n\t\tVectorN vec2 = VectorN.from(1, 2, 1);\n\t\tVectorN result = vec1.addNew(vec2);\n\t\tassertEquals(VectorN.from(6, 9, 4), result);\n\t\t\n\t\tvec1 = VectorN.from(-3, 0, 5);\n\t\tvec2 = VectorN.from(4, 2, -2);\n\t\tresult =...
{ "fields": [ { "declarator": "data", "modifier": "private", "original_string": "private double[] data;", "type": "double[]", "var_name": "data" } ], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/vector/VectorN.java", "identifier": "VectorN", "interfa...
{ "body": "public static VectorN from(final double... data)\n\t{\n\t\tif (data == null)\n\t\t{\n\t\t\treturn VectorN.empty();\n\t\t}\n\t\treturn new VectorN(data);\n\t}", "class_method_signature": "VectorN.from(final double... data)", "constructor": false, "full_signature": "public static VectorN from(final dou...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_89
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testSubtract()\n\t{\n\t\tVector2 vec1 = Vector2.fromXY(4, 2);\n\t\tVector2 vec2 = Vector2.fromXY(3, 5);\n\t\tvec1.subtract(vec2);\n\t\tassertEquals(Vector2.fromXY(1, -3), vec1);\n\t\t\n\t\tvec1 = Vector2.fromXY(1, 5);\n\t\tvec2 = Vector2.fromXY(-2, 5);\n\t\tvec1.subtract(vec2);\n\t\tas...
{ "fields": [ { "declarator": "x", "modifier": "private", "original_string": "private double x;", "type": "double", "var_name": "x" }, { "declarator": "y", "modifier": "private", "original_string": "private double y;", "type": "double", "var_name...
{ "body": "public Vector2 subtract(final IVector vector)\n\t{\n\t\tsetX(x() - vector.x());\n\t\tsetY(y() - vector.y());\n\t\treturn this;\n\t}", "class_method_signature": "Vector2.subtract(final IVector vector)", "constructor": false, "full_signature": "public Vector2 subtract(final IVector vector)", "identif...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_31
{ "fields": [ { "declarator": "startCenter = Vector2.zero()", "modifier": "private", "original_string": "private IVector2 startCenter = Vector2.zero();", "type": "IVector2", "var_name": "startCenter" }, { "declarator": "endCenter = Vector2.fromXY(1000, 0)", "modif...
{ "body": "@Test\n\tpublic void testIsIntersectingWithLine()\n\t{\n\t\tITube tube = Tube.create(startCenter, endCenter, radius);\n\t\tITube tubeZeroLength = Tube.create(startCenter, startCenter, radius);\n\t\t\n\t\tIVector2 p1 = Vector2.fromXY(0, 20);\n\t\tIVector2 p2 = Vector2.fromXY(0, -20);\n\t\tIVector2 p3 = Vect...
{ "fields": [ { "declarator": "startCenter", "modifier": "private final", "original_string": "private final IVector2 startCenter;", "type": "IVector2", "var_name": "startCenter" }, { "declarator": "endCenter", "modifier": "private final", "original_string": ...
{ "body": "public static Tube create(final IVector2 startCenter, final IVector2 endCenter, final double radius)\n\t{\n\t\tassert startCenter != null;\n\t\tassert endCenter != null;\n\t\treturn new Tube(startCenter, endCenter, radius);\n\t}", "class_method_signature": "Tube.create(final IVector2 startCenter, final I...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_114
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/VectorMathTest.java", "identifier": "VectorMathTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testNearestPointInList()\n\t{\n\t\tRandom rnd = new Random(239827);\n\t\tfor (int times = 0; times < 1e5; ++times)\n\t\t{\n\t\t\tList<IVector2> c = new ArrayList<>();\n\t\t\tfor (int i = rnd.nextInt(50) + 1; i > 0; --i)\n\t\t\t{\n\t\t\t\tdouble length = rnd.nextDouble() * 1000;\n\t\t\t...
{ "fields": [], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/vector/VectorMath.java", "identifier": "VectorMath", "interfaces": "", "methods": [ { "class_method_signature": "VectorMath.VectorMath()", "constructor": true, "full_signature": "@SuppressWarnings(\"unused...
{ "body": "static IVector2 nearestTo(final IVector2 p, final Collection<IVector2> points)\n\t{\n\t\tValidate.notEmpty(points);\n\t\tIVector2 closest = null;\n\t\tdouble closestDist = Double.MAX_VALUE;\n\t\tfor (IVector2 vec : points)\n\t\t{\n\t\t\tdouble dist = distancePPSqr(vec, p);\n\t\t\tif (closestDist > dist)\n\...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_180
{ "fields": [ { "declarator": "lineConstructor = dV -> LineSegment.fromPoints(Vector2f.ZERO_VECTOR,\n\t\t\tVector2f.ZERO_VECTOR.addNew(dV))", "modifier": "private final static", "original_string": "private final static LineConstructor lineConstructor = dV -> LineSegment.fromPoints(Vector2f.ZERO_...
{ "body": "@Test\n\tpublic void testToHalfLine()\n\t{\n\t\tIVector2 start = Vector2.fromXY(10, 20);\n\t\tIVector2 end = Vector2.fromXY(30, 40);\n\t\t\n\t\tILineSegment segment = LineSegment.fromPoints(start, end);\n\t\tIHalfLine line = segment.toHalfLine();\n\t\t\n\t\tassertThat(line.supportVector(), is(segment.getSt...
{ "fields": [ { "declarator": "start", "modifier": "private final", "original_string": "private final Vector2f start;", "type": "Vector2f", "var_name": "start" }, { "declarator": "end", "modifier": "private final", "original_string": "private final Vector2f ...
{ "body": "@Override\n\tpublic IHalfLine toHalfLine()\n\t{\n\t\treturn HalfLine.createNewWithoutCopy(getStart(), directionVector());\n\t}", "class_method_signature": "LineSegment.toHalfLine()", "constructor": false, "full_signature": "@Override public IHalfLine toHalfLine()", "identifier": "toHalfLine", "in...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_246
{ "fields": [ { "declarator": "depth = 400", "modifier": "private", "original_string": "private double depth = 400;", "type": "double", "var_name": "depth" }, { "declarator": "length = 800", "modifier": "private", "original_string": "private double length = ...
{ "body": "@Test\n\tpublic void isBehindPenaltyArea()\n\t{\n\t\tassertThat(penaltyArea.isBehindPenaltyArea(Vector2.fromXY(0, 0))).isFalse();\n\t\tassertThat(penaltyArea.isBehindPenaltyArea(Vector2.fromXY(borderX, 0))).isFalse();\n\t\tassertThat(penaltyArea.isBehindPenaltyArea(Vector2.fromXY(borderX + 1, 0))).isFalse(...
{ "fields": [ { "declarator": "goalCenterX", "modifier": "private final", "original_string": "private final double goalCenterX;", "type": "double", "var_name": "goalCenterX" }, { "declarator": "length", "modifier": "private final", "original_string": "privat...
{ "body": "@Override\n\tpublic boolean isBehindPenaltyArea(final IVector2 point)\n\t{\n\t\treturn (Math.abs(point.x()) > Math.abs(getGoalCenter().x()))\n\t\t\t\t&& ((int) Math.signum(point.x()) == (int) Math.signum(getGoalCenter().x()))\n\t\t\t\t&& Math.abs(point.y()) < getLength() / 2;\n\t}", "class_method_signatu...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_138
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testApply()\n\t{\n\t\tassertThat(Vector3.fromXYZ(1, -2, 3).apply(v -> Math.abs(v * 3))).isEqualTo(Vector3.fromXYZ(3, 6, 9));\n\t}", "class_method_signature": "Vector3Test.testApply()", "constructor": false, "full_signature": "@Test public void testApply()", "identifier": "testA...
{ "fields": [ { "declarator": "x", "modifier": "private", "original_string": "private double\tx;", "type": "double", "var_name": "x" }, { "declarator": "y", "modifier": "private", "original_string": "private double\ty;", "type": "double", "var_na...
{ "body": "public Vector3 apply(final Function<Double, Double> function)\n\t{\n\t\tx = function.apply(x);\n\t\ty = function.apply(y);\n\t\tz = function.apply(z);\n\t\treturn this;\n\t}", "class_method_signature": "Vector3.apply(final Function<Double, Double> function)", "constructor": false, "full_signature": "...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_211
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/pose/PoseTest.java", "identifier": "PoseTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void interpolate()\n\t{\n\t\tPose pose1 = Pose.from(Vector3.fromXYZ(2, 10, 0));\n\t\tPose pose2 = Pose.from(Vector3.fromXYZ(4, 12, 2));\n\t\tassertThat(pose1.interpolate(pose2, 0.0)).isEqualTo(pose1);\n\t\tassertThat(pose2.interpolate(pose1, 0.0)).isEqualTo(pose2);\n\t\tassertThat(pose1.int...
{ "fields": [ { "declarator": "pos", "modifier": "private final", "original_string": "private final IVector2 pos;", "type": "IVector2", "var_name": "pos" }, { "declarator": "orientation", "modifier": "private final", "original_string": "private final double ...
{ "body": "public Pose interpolate(Pose pose, double percentage)\n\t{\n\t\tdouble angleDiff = AngleMath.difference(pose.orientation, orientation) * percentage;\n\t\tdouble intpOrientation = AngleMath.normalizeAngle(orientation + angleDiff);\n\t\tIVector2 posDiff = pose.pos.subtractNew(pos).multiply(percentage);\n\t\t...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_207
{ "fields": [ { "declarator": "random", "modifier": "private", "original_string": "private Random random;", "type": "Random", "var_name": "random" }, { "declarator": "TEST_ACCURACY = 1e-3", "modifier": "private static final", "original_string": "private stat...
{ "body": "@Test\n\tpublic void testIsPointOnLineSegment()\n\t{\n\t\tILine segment = Line.fromPoints(Vector2f.ZERO_VECTOR, Vector2f.X_AXIS);\n\n\t\tfinal double margin = 1e-5;\n\t\tIVector2 point = Vector2.fromXY(1 + margin / 2.0, 0);\n\t\tAssert.assertTrue(LineMath.isPointOnLineSegment(segment, point, margin));\n\n\...
{ "fields": [ { "declarator": "ACCURACY = SumatraMath.getEqualTol()", "modifier": "private static final", "original_string": "private static final double ACCURACY = SumatraMath.getEqualTol();", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/mai...
{ "body": "public static boolean isPointOnLineSegment(ILine line, final IVector2 point, final double margin)\n\t{\n\t\tIVector2 lp = leadPointOnLine(line, point);\n\t\tdouble dist = VectorMath.distancePP(point, lp);\n\t\tif (dist > margin)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tdouble lineLength = line.directionVect...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_196
{ "fields": [ { "declarator": "lineConstructor = dV -> Line.fromDirection(Vector2f.ZERO_VECTOR, dV)", "modifier": "private final static", "original_string": "private final static LineConstructor lineConstructor = dV -> Line.fromDirection(Vector2f.ZERO_VECTOR, dV);", "type": "LineConstructo...
{ "body": "@Test\n\tpublic void testGetOrthogonalLine()\n\t{\n\t\tfor (int degAngle = 0; degAngle <= 360; degAngle += 10)\n\t\t{\n\t\t\tdouble radAngle = Math.toRadians(degAngle);\n\t\t\t\n\t\t\tIVector2 sV = Vector2.fromXY(degAngle, -degAngle);\n\t\t\tIVector2 dV = Vector2.fromAngle(radAngle);\n\t\t\t\n\t\t\tILine l...
{ "fields": [], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/line/v2/Line.java", "identifier": "Line", "interfaces": "implements ILine", "methods": [ { "class_method_signature": "Line.Line(final IVector2 supportVector, final IVector2 directionVector)", "constructor": true...
{ "body": "@Override\n\tpublic ILine getOrthogonalLine()\n\t{\n\t\tIVector2 sV = supportVector();\n\t\tIVector2 dV = directionVector().turnNew(Math.PI / 2);\n\t\treturn createNewFromVectorCopy(sV, dV);\n\t}", "class_method_signature": "Line.getOrthogonalLine()", "constructor": false, "full_signature": "@Overrid...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_179
{ "fields": [ { "declarator": "lineConstructor = dV -> LineSegment.fromPoints(Vector2f.ZERO_VECTOR,\n\t\t\tVector2f.ZERO_VECTOR.addNew(dV))", "modifier": "private final static", "original_string": "private final static LineConstructor lineConstructor = dV -> LineSegment.fromPoints(Vector2f.ZERO_...
{ "body": "@Test\n\tpublic void testEqualsForInvalid()\n\t{\n\t\tIVector2 start = Vector2.fromXY(10, 15);\n\t\tIVector2 end = Vector2.fromXY(20, 3);\n\t\t\n\t\tILineSegment valid = LineSegment.fromPoints(start, end);\n\t\tILineSegment invalidA = LineSegment.fromPoints(start, start);\n\t\tILineSegment invalidACopy = L...
{ "fields": [ { "declarator": "start", "modifier": "private final", "original_string": "private final Vector2f start;", "type": "Vector2f", "var_name": "start" }, { "declarator": "end", "modifier": "private final", "original_string": "private final Vector2f ...
{ "body": "public static ILineSegment fromPoints(final IVector2 start, final IVector2 end)\n\t{\n\t\treturn new LineSegment(start, end);\n\t}", "class_method_signature": "LineSegment.fromPoints(final IVector2 start, final IVector2 end)", "constructor": false, "full_signature": "public static ILineSegment fromPo...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_4
{ "fields": [ { "declarator": "params", "modifier": "private", "original_string": "private FixedLossPlusRollingParameters params;", "type": "FixedLossPlusRollingParameters", "var_name": "params" }, { "declarator": "consultant", "modifier": "private", "origin...
{ "body": "@Test\n\tpublic void testGetMinimumDistanceToOverChip()\n\t{\n\t\t// test specific values\n\t\tdouble dist = consultant.getMinimumDistanceToOverChip(3.0, 150);\n\t\tassertEquals(dist, 188.89098770912403, 1e-6);\n\t\t\n\t\t// test unreachable height\n\t\tdist = consultant.getMinimumDistanceToOverChip(1.0, 1...
{ "fields": [ { "declarator": "chipAngle = AngleMath.deg2rad(45)", "modifier": "private", "original_string": "private double chipAngle = AngleMath.deg2rad(45);", "type": "double", "var_name": "chipAngle" }, { "declarator": "params", "modifier": "private final", ...
{ "body": "@Override\n\tpublic double getMinimumDistanceToOverChip(final double initVel, final double height)\n\t{\n\t\tfinal double g = 9.81;\n\t\tdouble heightInM = height * 0.001;\n\t\tIVector2 kickVel = absoluteKickVelToVector(initVel);\n\t\tdouble velZ = kickVel.y();\n\t\t\n\t\t// maximum height at parabola peak...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_250
{ "fields": [], "file": "modules/sumatra-snapshot/src/test/java/edu/tigers/sumatra/snapshot/SnapshotTest.java", "identifier": "SnapshotTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testToJSON()\n\t{\n\t\tSnapshot snapshot = new Snapshot(new HashMap<>(), new SnapObject(Vector3.zero(), Vector3.zero()));\n\t\tassertEquals(\"{\\\"ball\\\":{\\\"pos\\\":[0.0,0.0,0.0],\\\"vel\\\":[0.0,0.0,0.0]},\\\"bots\\\":[]}\",\n\t\t\t\tsnapshot.toJSON().toJSONString());\n\t\t\n\t\tM...
{ "fields": [ { "declarator": "bots", "modifier": "private", "original_string": "private Map<BotID, SnapObject> bots;", "type": "Map<BotID, SnapObject>", "var_name": "bots" }, { "declarator": "ball", "modifier": "private", "original_string": "private SnapObj...
{ "body": "@SuppressWarnings(\"unchecked\")\n\tpublic JSONObject toJSON()\n\t{\n\t\tJSONObject obj = new JSONObject();\n\t\tobj.put(\"bots\", botsToJSON(bots));\n\t\tobj.put(\"ball\", ball.toJSON());\n\t\treturn obj;\n\t}", "class_method_signature": "Snapshot.toJSON()", "constructor": false, "full_signature": "...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_227
{ "fields": [ { "declarator": "ACCURACY = 1e-6", "modifier": "public static final", "original_string": "public static final double ACCURACY = 1e-6;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/angle/AngleTe...
{ "body": "@Test\n\tpublic void multiply()\n\t{\n\t\tassertEquals(0, Angle.zero().multiply(Math.PI / 2).multiply(42).asRad(), ACCURACY);\n\t\tassertEquals(42, Angle.ofDeg(21).multiply(1).multiply(2).asDeg(), ACCURACY);\n\t}", "class_method_signature": "AngleTest.multiply()", "constructor": false, "full_signatur...
{ "fields": [ { "declarator": "ZERO_ANGLE = new Angle()", "modifier": "private static final", "original_string": "private static final Angle ZERO_ANGLE = new Angle();", "type": "Angle", "var_name": "ZERO_ANGLE" } ], "file": "modules/common-math/src/main/java/edu/tigers/sumatr...
{ "body": "@Override\n\tpublic IAngle multiply(final double factor)\n\t{\n\t\treturn new Angle(this.angle * factor);\n\t}", "class_method_signature": "Angle.multiply(final double factor)", "constructor": false, "full_signature": "@Override public IAngle multiply(final double factor)", "identifier": "multiply"...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_159
{ "fields": [ { "declarator": "lineConstructor = dV -> HalfLine.fromDirection(Vector2f.ZERO_VECTOR, dV)", "modifier": "private final static", "original_string": "private final static LineConstructor lineConstructor = dV -> HalfLine.fromDirection(Vector2f.ZERO_VECTOR, dV);", "type": "LineCo...
{ "body": "@Test\n\tpublic void testFromDirection()\n\t{\n\t\tIVector2 supportVector = Vector2.fromXY(1, 1);\n\t\tIVector2 directionVector = Vector2.fromXY(4, 2);\n\t\t\n\t\tIHalfLine halfLine = HalfLine.fromDirection(supportVector, directionVector);\n\t\tassertThat(halfLine.supportVector(), is(supportVector));\n\t\t...
{ "fields": [], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/line/v2/HalfLine.java", "identifier": "HalfLine", "interfaces": "implements IHalfLine", "methods": [ { "class_method_signature": "HalfLine.HalfLine(final IVector2 supportVector, final IVector2 directionVector)", ...
{ "body": "public static IHalfLine fromDirection(final IVector2 supportVector, final IVector2 directionVector)\n\t{\n\t\tIVector2 sV = Vector2.copy(supportVector);\n\t\tIVector2 dV = directionVector.normalizeNew();\n\t\treturn createNewWithoutCopy(sV, dV);\n\t}", "class_method_signature": "HalfLine.fromDirection(fi...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_93
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testTurnTo()\n\t{\n\t\tVector2 vec1 = Vector2.fromXY(1, 0);\n\t\tvec1.turnTo(AngleMath.PI);\n\t\tassertEquals(vec1.x(), -1, ACCURACY);\n\t\tassertEquals(vec1.y(), 0, ACCURACY);\n\t\t\n\t\tvec1 = Vector2.fromXY(1, 0);\n\t\tvec1.turnTo(AngleMath.PI * (-0.5f));\n\t\tassertEquals(vec1.x(),...
{ "fields": [ { "declarator": "x", "modifier": "private", "original_string": "private double x;", "type": "double", "var_name": "x" }, { "declarator": "y", "modifier": "private", "original_string": "private double y;", "type": "double", "var_name...
{ "body": "public Vector2 turnTo(final double angle)\n\t{\n\t\tfinal double len = getLength2();\n\t\tsetY(SumatraMath.sin(angle) * len);\n\t\tsetX(SumatraMath.cos(angle) * len);\n\t\treturn this;\n\t}", "class_method_signature": "Vector2.turnTo(final double angle)", "constructor": false, "full_signature": "publ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_85
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testApply()\n\t{\n\t\tassertThat(VectorN.from(1, -2, 3).apply(v -> Math.abs(v * 3))).isEqualTo(VectorN.from(3, 6, 9));\n\t}", "class_method_signature": "VectorNTest.testApply()", "constructor": false, "full_signature": "@Test public void testApply()", "identifier": "testApply",...
{ "fields": [ { "declarator": "data", "modifier": "private", "original_string": "private double[] data;", "type": "double[]", "var_name": "data" } ], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/vector/VectorN.java", "identifier": "VectorN", "interfa...
{ "body": "public VectorN apply(final Function<Double, Double> function)\n\t{\n\t\tfor (int i = 0; i < getNumDimensions(); i++)\n\t\t{\n\t\t\tdata[i] = function.apply(get(i));\n\t\t}\n\t\treturn this;\n\t}", "class_method_signature": "VectorN.apply(final Function<Double, Double> function)", "constructor": false, ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_231
{ "fields": [], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/StatisticsMathTest.java", "identifier": "StatisticsMathTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testVariance()\n\t{\n\t\tAssertions.assertThat(StatisticsMath.variance(Arrays.asList(42, 42, 42))).isEqualTo(0);\n\t\tAssertions.assertThat(StatisticsMath.variance(Arrays.asList(43, 42, 41))).isEqualTo(2.0 / 3.0);\n\t}", "class_method_signature": "StatisticsMathTest.testVariance()", ...
{ "fields": [], "file": "modules/common-math/src/main/java/edu/tigers/sumatra/math/StatisticsMath.java", "identifier": "StatisticsMath", "interfaces": "", "methods": [ { "class_method_signature": "StatisticsMath.StatisticsMath()", "constructor": true, "full_signature": "@SuppressWarnings...
{ "body": "public static <T extends Number> double variance(final List<T> values)\n\t{\n\t\tdouble mu = mean(values);\n\t\tList<Number> val2 = new ArrayList<>(values.size());\n\t\tfor (Number f : values)\n\t\t{\n\t\t\tdouble diff = f.doubleValue() - mu;\n\t\t\tval2.add(diff * diff);\n\t\t}\n\t\treturn mean(val2);\n\t...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }
139621153_118
{ "fields": [ { "declarator": "ACCURACY = 0.001", "modifier": "private static final", "original_string": "private static final double ACCURACY = 0.001;", "type": "double", "var_name": "ACCURACY" } ], "file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Ve...
{ "body": "@Test\n\tpublic void testAddNew()\n\t{\n\t\tVector3 vec1 = Vector3.fromXYZ(5, 7, 3);\n\t\tVector3 vec2 = Vector3.fromXYZ(1, 2, 1);\n\t\tVector3 result = vec1.addNew(vec2);\n\t\tassertEquals(Vector3.fromXYZ(6, 9, 4), result);\n\t\t\n\t\tvec1 = Vector3.fromXYZ(-3, 0, 5);\n\t\tvec2 = Vector3.fromXYZ(4, 2, -2)...
{ "fields": [ { "declarator": "x", "modifier": "private", "original_string": "private double\tx;", "type": "double", "var_name": "x" }, { "declarator": "y", "modifier": "private", "original_string": "private double\ty;", "type": "double", "var_na...
{ "body": "public static Vector3 fromXYZ(final double x, final double y, final double z)\n\t{\n\t\treturn new Vector3(x, y, z);\n\t}", "class_method_signature": "Vector3.fromXYZ(final double x, final double y, final double z)", "constructor": false, "full_signature": "public static Vector3 fromXYZ(final double ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 139621153, "size": 5266, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/TIGERs-Mannheim/AutoReferee" }