id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
10367500_1 | {
"fields": [
{
"declarator": "FIDELITY = \"Fidelity\"",
"modifier": "private static final",
"original_string": "private static final String FIDELITY = \"Fidelity\";",
"type": "String",
"var_name": "FIDELITY"
},
{
"declarator": "HIGH_TECH = \"HighTech\"",
"modifie... | {
"body": "@Test\n\tpublic void testGetTotalValue() {\n\t\tDouble actual = portfolio.getTotalValue();\n\t\tassertEquals(0d, actual, 0.1);\n\t}",
"class_method_signature": "PortfolioTest.testGetTotalValue()",
"constructor": false,
"full_signature": "@Test public void testGetTotalValue()",
"identifier": "testGe... | {
"fields": [
{
"declarator": "mathContext = MathContext.DECIMAL32",
"modifier": "private final",
"original_string": "private final MathContext mathContext = MathContext.DECIMAL32;",
"type": "MathContext",
"var_name": "mathContext"
},
{
"declarator": "PERCENT = 100",
... | {
"body": "public final Double getTotalValue() {\n\t\treturn totalValue + getLiquidity();\n\t}",
"class_method_signature": "Portfolio.getTotalValue()",
"constructor": false,
"full_signature": "public final Double getTotalValue()",
"identifier": "getTotalValue",
"invocations": [
"getLiquidity"
],
"mo... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 10367500,
"size": 26997,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/carlphilipp/stock-tracker"
} |
10367500_16 | {
"fields": [
{
"declarator": "FIDELITY = \"Fidelity\"",
"modifier": "private static final",
"original_string": "private static final String FIDELITY = \"Fidelity\";",
"type": "String",
"var_name": "FIDELITY"
},
{
"declarator": "HIGH_TECH = \"HighTech\"",
"modifie... | {
"body": "@Test\n\tpublic void testGetGapByCompanies() {\n\t\tportfolio.setEquities(createEquities());\n\t\tMap<String, List<Equity>> actual = portfolio.getGapByCompanies();\n\t\tassertNotNull(actual);\n\t\tassertThat(actual.size(), is(3));\n\t\tassertTrue(actual.containsKey(LARGE_CAP.getValue()));\n\t\tassertTrue(a... | {
"fields": [
{
"declarator": "mathContext = MathContext.DECIMAL32",
"modifier": "private final",
"original_string": "private final MathContext mathContext = MathContext.DECIMAL32;",
"type": "MathContext",
"var_name": "mathContext"
},
{
"declarator": "PERCENT = 100",
... | {
"body": "protected Map<String, List<Equity>> getGapByCompanies() {\n\t\tfinal Map<String, List<Equity>> map = new TreeMap<>();\n\t\tList<Equity> companies;\n\t\tfor (final Equity equity : getEquities()) {\n\t\t\tif (equity.getMarketCapitalizationType().getValue() == null || equity.getCompany().getFund()) {\n\t\t\t\... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 10367500,
"size": 26997,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/carlphilipp/stock-tracker"
} |
10367500_6 | {
"fields": [
{
"declarator": "FIDELITY = \"Fidelity\"",
"modifier": "private static final",
"original_string": "private static final String FIDELITY = \"Fidelity\";",
"type": "String",
"var_name": "FIDELITY"
},
{
"declarator": "HIGH_TECH = \"HighTech\"",
"modifie... | {
"body": "@Test\n\tpublic void testGetChartCapData() {\n\t\tportfolio.setEquities(createEquities());\n\t\tMap<String, Double> actual = portfolio.getChartCapData();\n\t\tassertNotNull(actual);\n\t\tassertEquals(1000d, actual.get(MEGA_CAP.getValue()), 0.1);\n\t\tassertEquals(4000d, actual.get(LARGE_CAP.getValue()), 0.... | {
"fields": [
{
"declarator": "mathContext = MathContext.DECIMAL32",
"modifier": "private final",
"original_string": "private final MathContext mathContext = MathContext.DECIMAL32;",
"type": "MathContext",
"var_name": "mathContext"
},
{
"declarator": "PERCENT = 100",
... | {
"body": "protected final Map<String, Double> getChartCapData() {\n\t\tif (chartCapData == null) {\n\t\t\tMap<String, Double> data = new HashMap<>();\n\t\t\tfor (Equity equity : getEquities()) {\n\t\t\t\tif (!equity.getCompany().getFund()) {\n\t\t\t\t\tMarketCapitalization marketCap = equity.getMarketCapitalizationT... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 10367500,
"size": 26997,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/carlphilipp/stock-tracker"
} |
10367500_11 | {
"fields": [
{
"declarator": "FIDELITY = \"Fidelity\"",
"modifier": "private static final",
"original_string": "private static final String FIDELITY = \"Fidelity\";",
"type": "String",
"var_name": "FIDELITY"
},
{
"declarator": "HIGH_TECH = \"HighTech\"",
"modifie... | {
"body": "@Test\n\tpublic void testGetAccountById() {\n\t\tportfolio.setAccounts(createAccounts());\n\t\tOptional<Account> actual = portfolio.getAccount(2);\n\t\tassertTrue(actual.isPresent());\n\t}",
"class_method_signature": "PortfolioTest.testGetAccountById()",
"constructor": false,
"full_signature": "@Test... | {
"fields": [
{
"declarator": "mathContext = MathContext.DECIMAL32",
"modifier": "private final",
"original_string": "private final MathContext mathContext = MathContext.DECIMAL32;",
"type": "MathContext",
"var_name": "mathContext"
},
{
"declarator": "PERCENT = 100",
... | {
"body": "public final Optional<Account> getAccount(final String name) {\n\t\treturn accounts == null\n\t\t\t? Optional.empty()\n\t\t\t: accounts.stream().filter(account -> account.getName().equals(name)).findFirst();\n\t}",
"class_method_signature": "Portfolio.getAccount(final String name)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 10367500,
"size": 26997,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/carlphilipp/stock-tracker"
} |
10367500_10 | {
"fields": [
{
"declarator": "FIDELITY = \"Fidelity\"",
"modifier": "private static final",
"original_string": "private static final String FIDELITY = \"Fidelity\";",
"type": "String",
"var_name": "FIDELITY"
},
{
"declarator": "HIGH_TECH = \"HighTech\"",
"modifie... | {
"body": "@Test\n\tpublic void testGetAccountByName() {\n\t\tportfolio.setAccounts(createAccounts());\n\t\tOptional<Account> actual = portfolio.getAccount(FIDELITY);\n\t\tassertTrue(actual.isPresent());\n\t}",
"class_method_signature": "PortfolioTest.testGetAccountByName()",
"constructor": false,
"full_signatu... | {
"fields": [
{
"declarator": "mathContext = MathContext.DECIMAL32",
"modifier": "private final",
"original_string": "private final MathContext mathContext = MathContext.DECIMAL32;",
"type": "MathContext",
"var_name": "mathContext"
},
{
"declarator": "PERCENT = 100",
... | {
"body": "public final Optional<Account> getAccount(final String name) {\n\t\treturn accounts == null\n\t\t\t? Optional.empty()\n\t\t\t: accounts.stream().filter(account -> account.getName().equals(name)).findFirst();\n\t}",
"class_method_signature": "Portfolio.getAccount(final String name)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 10367500,
"size": 26997,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/carlphilipp/stock-tracker"
} |
10367500_7 | {
"fields": [
{
"declarator": "FIDELITY = \"Fidelity\"",
"modifier": "private static final",
"original_string": "private static final String FIDELITY = \"Fidelity\";",
"type": "String",
"var_name": "FIDELITY"
},
{
"declarator": "HIGH_TECH = \"HighTech\"",
"modifie... | {
"body": "@Test\n\tpublic void testGetCompaniesYahooIdRealTime() {\n\t\tportfolio.setEquities(createEquities());\n\t\tList<String> actual = portfolio.getCompaniesYahooIdRealTime();\n\t\tassertNotNull(actual);\n\t\tassertThat(actual, containsInAnyOrder(GOOGLE, APPLE));\n\t}",
"class_method_signature": "PortfolioTes... | {
"fields": [
{
"declarator": "mathContext = MathContext.DECIMAL32",
"modifier": "private final",
"original_string": "private final MathContext mathContext = MathContext.DECIMAL32;",
"type": "MathContext",
"var_name": "mathContext"
},
{
"declarator": "PERCENT = 100",
... | {
"body": "public final List<String> getCompaniesYahooIdRealTime() {\n\t\treturn getEquities().stream()\n\t\t\t.filter(equity -> equity.getCompany().getRealTime())\n\t\t\t.map(equity -> equity.getCompany().getYahooId())\n\t\t\t.collect(Collectors.toList());\n\t}",
"class_method_signature": "Portfolio.getCompaniesYa... | {
"created": null,
"fork": null,
"fork_count": 1,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 10367500,
"size": 26997,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/carlphilipp/stock-tracker"
} |
26907542_0 | {
"fields": [
{
"declarator": "asserts = new HashMap<>()",
"modifier": "private",
"original_string": "private Map<String, String> asserts = new HashMap<>();",
"type": "Map<String, String>",
"var_name": "asserts"
}
],
"file": "jpafilterbuilder/src/test/java/ru/savvy/jpafilterb... | {
"body": "@Test\n public void dateConvertTest() throws Exception {\n for (Map.Entry<String, String> entry : asserts.entrySet()){\n Date expected = new SimpleDateFormat(entry.getValue()).parse(entry.getKey());\n assertEquals(expected, FilterConverterHelper.dateConvert(entry.getKey()));... | {
"fields": [
{
"declarator": "logger = LogFactory.getLog(FilterConverterHelper.class.getCanonicalName())",
"modifier": "private static",
"original_string": "private static Log logger = LogFactory.getLog(FilterConverterHelper.class.getCanonicalName());",
"type": "Log",
"var_name": "l... | {
"body": "public static Date dateConvert(String value) {\n\n if (value == null) {\n return null;\n }\n\n Map<String, String> formats = new HashMap<>();\n\n formats.put(\"dd.MM.yyyy HH:mm\", \"^\\\\d{2}\\\\.\\\\d{2}\\\\.\\\\d{4}\\\\s+\\\\d{2}:\\\\d{2}$\");\n formats.put(\... | {
"created": null,
"fork": null,
"fork_count": 3,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 26907542,
"size": 184,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/sasa7812/jfbdemo"
} |
30806608_0 | {
"fields": [
{
"declarator": "mActivity",
"modifier": "private",
"original_string": "private FullscreenActivity mActivity;",
"type": "FullscreenActivity",
"var_name": "mActivity"
}
],
"file": "app/src/test/java/com/mschlauch/comfortreader/StringSegmenterTest.java",
"identi... | {
"body": "@Test\n public void getsegmenthtml() throws Exception {\n TextView contentView = (TextView) mActivity.findViewById(R.id.fullscreen_content);\n String first = contentView.getText().toString();\n mActivity.nextButtonClicked(contentView);\n String second = contentView.getText().... | {
"fields": [
{
"declarator": "backgroundcolor",
"modifier": "public",
"original_string": "public int backgroundcolor;",
"type": "int",
"var_name": "backgroundcolor"
},
{
"declarator": "textcolor",
"modifier": "public",
"original_string": "public int textcol... | {
"body": "public String getsegmenthtml(int tick) {\n\n\n\n\n\t\tint r1 = Color.red(textcolor);\n\t\tint g1 = Color.green(textcolor);\n\t\tint b1 = Color.blue(textcolor);\n\n\t\tint r2 = Color.red(emphasiscolor);\n\t\tint g2 = Color.green(emphasiscolor);\n\t\tint b2 = Color.blue(emphasiscolor);\n\n\n\n\t\tString hext... | {
"created": null,
"fork": null,
"fork_count": 10,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 30806608,
"size": 252701,
"stargazer_count": 24,
"stars": null,
"updates": null,
"url": "https://github.com/mschlauch/comfortreader"
} |
106921925_4 | {
"fields": [
{
"declarator": "handler",
"modifier": "@InjectMocks\n private",
"original_string": "@InjectMocks\n private AuditConsumerChannelHandlerImpl handler;",
"type": "AuditConsumerChannelHandlerImpl",
"var_name": "handler"
},
{
"declarator": "eventsReposito... | {
"body": "@Test\n public void messageIdShouldBeSet(){\n //given\n CloudRuntimeEvent cloudRuntimeEvent = mock(CloudRuntimeEventImpl.class);\n when(cloudRuntimeEvent.getEventType()).thenReturn(ProcessRuntimeEvent.ProcessEvents.PROCESS_CREATED);\n EventToEntityConverter converter = mock(E... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(AuditConsumerChannelHandlerImpl.class)",
"modifier": "private static",
"original_string": "private static Logger LOGGER = LoggerFactory.getLogger(AuditConsumerChannelHandlerImpl.class);",
"type": "Logger",
"var_name": "L... | {
"body": "@SuppressWarnings(\"unchecked\")\n @Override\n @StreamListener(AuditConsumerChannels.AUDIT_CONSUMER)\n public void receiveCloudRuntimeEvent(@Headers Map<String, Object> headers, CloudRuntimeEvent<?, ?>... events) {\n if (events != null) {\n AtomicInteger counter = new AtomicInteg... | {
"created": null,
"fork": null,
"fork_count": 12,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 106921925,
"size": 1263,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/Activiti/activiti-cloud-audit-service"
} |
106921925_3 | {
"fields": [
{
"declarator": "handler",
"modifier": "@InjectMocks\n private",
"original_string": "@InjectMocks\n private AuditConsumerChannelHandlerImpl handler;",
"type": "AuditConsumerChannelHandlerImpl",
"var_name": "handler"
},
{
"declarator": "eventsReposito... | {
"body": "@Test\n public void receiveEventShouldStoreEntity() {\n //given\n CloudRuntimeEvent cloudRuntimeEvent = mock(CloudRuntimeEventImpl.class);\n when(cloudRuntimeEvent.getEventType()).thenReturn(ProcessRuntimeEvent.ProcessEvents.PROCESS_CREATED);\n EventToEntityConverter converte... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(AuditConsumerChannelHandlerImpl.class)",
"modifier": "private static",
"original_string": "private static Logger LOGGER = LoggerFactory.getLogger(AuditConsumerChannelHandlerImpl.class);",
"type": "Logger",
"var_name": "L... | {
"body": "@SuppressWarnings(\"unchecked\")\n @Override\n @StreamListener(AuditConsumerChannels.AUDIT_CONSUMER)\n public void receiveCloudRuntimeEvent(@Headers Map<String, Object> headers, CloudRuntimeEvent<?, ?>... events) {\n if (events != null) {\n AtomicInteger counter = new AtomicInteg... | {
"created": null,
"fork": null,
"fork_count": 12,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 106921925,
"size": 1263,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/Activiti/activiti-cloud-audit-service"
} |
106921925_2 | {
"fields": [
{
"declarator": "eventConverter",
"modifier": "@Spy\n @InjectMocks\n private",
"original_string": "@Spy\n @InjectMocks\n private ProcessStartedEventConverter eventConverter;",
"type": "ProcessStartedEventConverter",
"var_name": "eventConverter"
},
{
... | {
"body": "@Test\n public void convertToAPIShouldCreateAPIEventAndCallEventContextInfoAppender() {\n //given\n ProcessStartedAuditEventEntity auditEventEntity = new ProcessStartedAuditEventEntity();\n CloudProcessStartedEventImpl apiEvent = new CloudProcessStartedEventImpl();\n doReturn... | {
"fields": [],
"file": "activiti-cloud-services-audit-jpa/src/main/java/org/activiti/cloud/services/audit/jpa/converters/ProcessStartedEventConverter.java",
"identifier": "ProcessStartedEventConverter",
"interfaces": "",
"methods": [
{
"class_method_signature": "ProcessStartedEventConverter.Process... | {
"body": "@Override\n protected CloudRuntimeEventImpl<?, ?> createAPIEvent(AuditEventEntity auditEventEntity) {\n ProcessStartedAuditEventEntity processStartedAuditEventEntity = (ProcessStartedAuditEventEntity) auditEventEntity;\n\n return new CloudProcessStartedEventImpl(processStartedAuditEventEnt... | {
"created": null,
"fork": null,
"fork_count": 12,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 106921925,
"size": 1263,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/Activiti/activiti-cloud-audit-service"
} |
106921925_1 | {
"fields": [
{
"declarator": "eventConverter",
"modifier": "@Spy\n @InjectMocks\n private",
"original_string": "@Spy\n @InjectMocks\n private ProcessStartedEventConverter eventConverter;",
"type": "ProcessStartedEventConverter",
"var_name": "eventConverter"
},
{
... | {
"body": "@Test\n public void convertToEntityShouldReturnCreatedEntity() {\n //given\n ProcessStartedAuditEventEntity auditEventEntity = new ProcessStartedAuditEventEntity();\n CloudProcessStartedEventImpl cloudRuntimeEvent = new CloudProcessStartedEventImpl();\n doReturn(auditEventEnt... | {
"fields": [],
"file": "activiti-cloud-services-audit-jpa/src/main/java/org/activiti/cloud/services/audit/jpa/converters/ProcessStartedEventConverter.java",
"identifier": "ProcessStartedEventConverter",
"interfaces": "",
"methods": [
{
"class_method_signature": "ProcessStartedEventConverter.Process... | {
"body": "@Override\n protected ProcessStartedAuditEventEntity createEventEntity(CloudRuntimeEvent cloudRuntimeEvent) {\n return new ProcessStartedAuditEventEntity((CloudProcessStartedEvent) cloudRuntimeEvent);\n }",
"class_method_signature": "ProcessStartedEventConverter.createEventEntity(CloudRuntim... | {
"created": null,
"fork": null,
"fork_count": 12,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 106921925,
"size": 1263,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/Activiti/activiti-cloud-audit-service"
} |
106921925_0 | {
"fields": [
{
"declarator": "eventConverter",
"modifier": "@Spy\n @InjectMocks\n private",
"original_string": "@Spy\n @InjectMocks\n private ProcessStartedEventConverter eventConverter;",
"type": "ProcessStartedEventConverter",
"var_name": "eventConverter"
},
{
... | {
"body": "@Test\n public void createEventEntityShouldSetAllNonProcessContextRelatedFields() {\n //given\n CloudProcessStartedEventImpl event = buildProcessStartedEvent();\n\n //when\n ProcessStartedAuditEventEntity auditEventEntity = eventConverter.createEventEntity(event);\n \n ... | {
"fields": [],
"file": "activiti-cloud-services-audit-jpa/src/main/java/org/activiti/cloud/services/audit/jpa/converters/ProcessStartedEventConverter.java",
"identifier": "ProcessStartedEventConverter",
"interfaces": "",
"methods": [
{
"class_method_signature": "ProcessStartedEventConverter.Process... | {
"body": "@Override\n protected ProcessStartedAuditEventEntity createEventEntity(CloudRuntimeEvent cloudRuntimeEvent) {\n return new ProcessStartedAuditEventEntity((CloudProcessStartedEvent) cloudRuntimeEvent);\n }",
"class_method_signature": "ProcessStartedEventConverter.createEventEntity(CloudRuntim... | {
"created": null,
"fork": null,
"fork_count": 12,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 106921925,
"size": 1263,
"stargazer_count": 7,
"stars": null,
"updates": null,
"url": "https://github.com/Activiti/activiti-cloud-audit-service"
} |
139621153_22 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/circle/CircleMathTest.java",
"identifier": "CircleMathTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void stepAlongCircle()\n\t{\n\t\tIVector2 center = Vector2.fromXY(100, 100);\n\t\t\n\t\tassertThat(CircleMath.stepAlongCircle(Vector2.fromXY(300, 100), center, Math.PI / 2)\n\t\t\t\t.distanceTo(Vector2.fromXY(100, 300)) < 1e-3).isTrue();\n\t\t\n\t\tassertThat(CircleMath.stepAlongCircle(Vect... | {
"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 Vector2 stepAlongCircle(final IVector2 current, final IVector2 center, final double angle)\n\t{\n\t\treturn current.subtractNew(center).turn(angle).add(center);\n\t}",
"class_method_signature": "CircleMath.stepAlongCircle(final IVector2 current, final IVector2 center, final double angle)",
... | {
"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_107 | {
"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 testToJSON()\n\t{\n\t\tassertThat(Vector2.fromXY(42, 1337).toJSON().toJSONString()).isEqualTo(\"{\\\"dim1\\\":1337.0,\\\"dim0\\\":42.0}\");\n\t}",
"class_method_signature": "Vector2Test.testToJSON()",
"constructor": false,
"full_signature": "@Test public void testToJSON()",
"id... | {
"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_150 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/SumatraMathTest.java",
"identifier": "SumatraMathTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testHasDigitsAfterDecimal()\n\t{\n\t\tAssert.assertFalse(SumatraMath.hasDigitsAfterDecimalPoint(1.0f));\n\t\tAssert.assertTrue(SumatraMath.hasDigitsAfterDecimalPoint(1.22f));\n\t\tAssert.assertTrue(SumatraMath.hasDigitsAfterDecimalPoint(-1.02f));\n\t\tAssert.assertFalse(SumatraMath.has... | {
"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 hasDigitsAfterDecimalPoint(final double number)\n\t{\n\t\tfinal double numberInt = Math.ceil(number);\n\t\t\n\t\treturn !isEqual(number, numberInt);\n\t}",
"class_method_signature": "SumatraMath.hasDigitsAfterDecimalPoint(final double number)",
"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_75 | {
"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(VectorN.from(42, 1337, 3.14).getSaveableString())\n\t\t\t\t.isEqualTo(42d + \";\" + 1337d + \";\" + 3.14);\n\t}",
"class_method_signature": "VectorNTest.testGetSaveableString()",
"constructor": false,
"full_signature": "@Test public vo... | {
"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_63 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Vector2fTest.java",
"identifier": "Vector2fTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetXYVector()\n\t{\n\t\tassertThat(Vector2f.fromXY(42, 1337).getXYVector()).isEqualTo(Vector2.fromXY(42, 1337));\n\t}",
"class_method_signature": "Vector2fTest.testGetXYVector()",
"constructor": false,
"full_signature": "@Test public void testGetXYVector()",
"identifier": "... | {
"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": "@Override\n\tpublic Vector2 getXYVector()\n\t{\n\t\treturn Vector2.copy(this);\n\t}",
"class_method_signature": "Vector2f.getXYVector()",
"constructor": false,
"full_signature": "@Override public Vector2 getXYVector()",
"identifier": "getXYVector",
"invocations": [
"copy"
],
"modifiers": ... | {
"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_146 | {
"fields": [
{
"declarator": "converter = new VectorConverter()",
"modifier": "private",
"original_string": "private VectorConverter converter = new VectorConverter();",
"type": "VectorConverter",
"var_name": "converter"
}
],
"file": "modules/common-math/src/test/java/edu/ti... | {
"body": "@Test\n\tpublic void testSupportedClass()\n\t{\n\t\tassertThat(converter.supportedClass(IVector.class)).isTrue();\n\t\tassertThat(converter.supportedClass(IVector2.class)).isTrue();\n\t\tassertThat(converter.supportedClass(IVector3.class)).isTrue();\n\t\tassertThat(converter.supportedClass(IVectorN.class))... | {
"fields": [
{
"declarator": "log = LogManager.getLogger(VectorConverter.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger log = LogManager.getLogger(VectorConverter.class.getName());",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "@Override\n\tpublic boolean supportedClass(final Class<?> impl)\n\t{\n\t\treturn impl.equals(IVector.class)\n\t\t\t\t|| impl.equals(IVector2.class)\n\t\t\t\t|| impl.equals(IVector3.class)\n\t\t\t\t|| impl.equals(IVectorN.class);\n\t}",
"class_method_signature": "VectorConverter.supportedClass(final Class... | {
"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_111 | {
"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\tassertThat(Vector2.fromXY(42, 1337).getXYZVector()).isEqualTo(Vector3.fromXYZ(42, 1337, 0));\n\t}",
"class_method_signature": "Vector2Test.testGetXYZVector()",
"constructor": false,
"full_signature": "@Test public void testGetXYZVector()",
"identifi... | {
"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_34 | {
"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 testLineIntersections()\n\t{\n\t\tfinal Vector2 start = Vector2.fromXY(1, 5);\n\t\tfinal Vector2 end = Vector2.fromXY(-2, 5);\n\t\tITube tube = Tube.create(start, end, 10);\n\t\t\n\t\tassertThat(tube.lineIntersections(Lines.segmentFromPoints(start, Vector2.fromXY(12, 5))))\n\t\t\t\t.co... | {
"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 List<IVector2> lineIntersections(final ILine line)\n\t{\n\t\tif (startCenter.equals(endCenter))\n\t\t{\n\t\t\treturn Circle.createCircle(startCenter, radius).lineIntersections(line);\n\t\t}\n\t\tICircle startCircle = Circle.createCircle(startCenter, radius);\n\t\tICircle endCircle = Cir... | {
"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_238 | {
"fields": [
{
"declarator": "NUMBER_OF_TESTS = 10000",
"modifier": "private static final",
"original_string": "private static final int NUMBER_OF_TESTS = 10000;",
"type": "int",
"var_name": "NUMBER_OF_TESTS"
},
{
"declarator": "POS_LIMIT = 10.0",
"modifier": "pr... | {
"body": "@Test\n\tpublic void testGetMinimumDistanceTwoTrajRandom()\n\t{\n\t\tfor (int i = 0; i < NUMBER_OF_TESTS; i++)\n\t\t{\n\t\t\tIVector2 initialPos1 = getRandomVector(POS_LIMIT);\n\t\t\tIVector2 finalPos1 = getRandomVector(POS_LIMIT);\n\t\t\tIVector2 initialVel1 = getRandomVector(2.0);\n\t\t\t\n\t\t\tIVector2... | {
"fields": [
{
"declarator": "segments",
"modifier": "private final",
"original_string": "private final List<PlanarCurveSegment> segments;",
"type": "List<PlanarCurveSegment>",
"var_name": "segments"
}
],
"file": "modules/common/src/main/java/edu/tigers/sumatra/planarcurve/P... | {
"body": "public double getMinimumDistanceToCurve(final PlanarCurve curve)\n\t{\n\t\tList<Pair<PlanarCurveSegment, PlanarCurveSegment>> combined = combineCurves(segments, curve.getSegments());\n\t\t\n\t\tdouble min = combined.get(0).getFirst().getPos().distanceTo(combined.get(0).getSecond().getPos());\n\t\t\n\t\tfor... | {
"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_185 | {
"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 testIsPointOnLine()\n\t{\n\t\tILineSegment segment = LineSegment.fromPoints(Vector2f.ZERO_VECTOR, Vector2.fromXY(3, 0));\n\t\t\n\t\tIVector2 point = Vector2.fromXY(-10, 0);\n\t\tassertThat(segment.isPointOnLine(point), is(false));\n\t\t\n\t\tpoint = Vector2.fromXY(-ALine.LINE_MARGIN * ... | {
"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_243 | {
"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 lineIntersectionsWithLineSegment()\n\t{\n\t\tassertThat(penaltyArea.lineIntersections(\n\t\t\t\tLines.segmentFromPoints(center, goalCenter)))\n\t\t\t\t\t\t.as(\"Does not intersect front border center\")\n\t\t\t\t\t\t.containsExactly(penBorderCenter);\n\n\t\tassertThat(penaltyArea.lineI... | {
"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 List<IVector2> lineIntersections(final edu.tigers.sumatra.math.line.v2.ILine line)\n\t{\n\t\treturn getEdges().stream()\n\t\t\t\t.map(edge -> edge.intersectLine(line))\n\t\t\t\t.filter(Optional::isPresent)\n\t\t\t\t.map(Optional::get)\n\t\t\t\t.distinct()\n\t\t\t\t.collect(Collectors.to... | {
"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_18 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/circle/CircleMathTest.java",
"identifier": "CircleMathTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void isPointInArc90degStartMinus180deg()\n\t{\n\t\tdouble radius = 300;\n\t\tdouble margin = 0.0;\n\t\tdouble start = -AngleMath.PI;\n\t\tdouble rotation = AngleMath.PI_HALF;\n\t\tIVector2 center = Vector2.fromXY(1000, -100);\n\t\tIArc arc = Arc.createArc(center, radius, start, rotation);\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 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_214 | {
"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 ofDeg()\n\t{\n\t\tassertEquals(0, Rotation.ofDeg(0).asRad(), ACCURACY);\n\t\tassertEquals(Math.PI * 2, Rotation.ofDeg(360).asRad(), ACCURACY);\n\t\tassertEquals(Math.PI / 2, Rotation.ofDeg(90).asRad(), ACCURACY);\n\t\tassertEquals(-3 * Math.PI / 2, Rotation.ofDeg(-270).asRad(), ACCURAC... | {
"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 ofDeg(double deg)\n\t{\n\t\treturn new Rotation(deg2rad(deg));\n\t}",
"class_method_signature": "Rotation.ofDeg(double deg)",
"constructor": false,
"full_signature": "public static Rotation ofDeg(double deg)",
"identifier": "ofDeg",
"invocations": [
"deg2rad"
],
"mo... | {
"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_202 | {
"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 testIntersectHalfLine()\n\t{\n\t\tIVector2 directionVector = Vector2f.X_AXIS;\n\t\tIHalfLine halfLine = HalfLine.fromDirection(Vector2f.ZERO_VECTOR, directionVector);\n\t\t\n\t\tfor (int degAngle = 0; degAngle < 180; degAngle++)\n\t\t{\n\t\t\tdouble radAngle = Math.toRadians(degAngle);... | {
"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<IVector2> intersectHalfLine(final IHalfLine halfLine)\n\t{\n\t\tif (this.isValid() && halfLine.isValid())\n\t\t{\n\t\t\treturn LineMath.intersectionPointOfLineAndHalfLine(this, halfLine);\n\t\t}\n\t\treturn Optional.empty();\n\t}",
"class_method_signature": "Line.intersectHal... | {
"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_59 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Vector2fTest.java",
"identifier": "Vector2fTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testEquals()\n\t{\n\t\tEqualsVerifier.forClass(Vector2f.class)\n\t\t\t\t.suppress(Warning.NONFINAL_FIELDS)\n\t\t\t\t.verify();\n\t\t\n\t\tassertThat(Vector2.fromXY(42, 1337)).isEqualTo(Vector2f.fromXY(42, 1337));\n\t\t\n\t}",
"class_method_signature": "Vector2fTest.testEquals()",
"... | {
"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_1 | {
"fields": [
{
"declarator": "c",
"modifier": "private",
"original_string": "private BotStateTrajectorySync c;",
"type": "BotStateTrajectorySync",
"var_name": "c"
}
],
"file": "modules/moduli-wp/src/test/java/edu/tigers/sumatra/wp/util/BotStateTrajectorySyncTest.java",
"id... | {
"body": "@Test\n\tpublic void getState()\n\t{\n\t\tOptional<State> botState = updateState(Vector3.fromXY(1, 0), 1);\n\t\tassertThat(botState).isNotPresent();\n\n\t\tbotState = updateState(Vector3.fromXY(3, 0), 3);\n\t\tassertThat(botState).isPresent();\n\t\tassertThat(botState.get().getPos()).isEqualTo(Vector2.from... | {
"fields": [
{
"declarator": "horizon = 0.2",
"modifier": "@Configurable(defValue = \"0.2\", comment = \"Time horizon [s] that is buffered (requires Moduli-reload)\")\n\tprivate static",
"original_string": "@Configurable(defValue = \"0.2\", comment = \"Time horizon [s] that is buffered (require... | {
"body": "public Optional<State> getState(final long timestamp, final double feedbackDelay)\n\t{\n\t\tlong pastTimestamp = timestamp - (long) (feedbackDelay * 1e9);\n\t\treturn buffer.get(pastTimestamp).map(p -> p.interpolate(pastTimestamp));\n\t}",
"class_method_signature": "BotStateTrajectorySync.getState(final ... | {
"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_193 | {
"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 testCopy()\n\t{\n\t\tILine original = Line.fromDirection(Vector2.fromXY(0, 0), Vector2.fromXY(1, 1));\n\t\tILine copy = original.copy();\n\t\t\n\t\tassertEquals(original.supportVector(), copy.supportVector());\n\t\tassertFalse(original.supportVector() == copy.supportVector());\n\t\t\n\... | {
"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 copy()\n\t{\n\t\tIVector2 supportVector = supportVector();\n\t\tIVector2 directionVector = directionVector();\n\t\treturn createNewFromVectorCopy(supportVector, directionVector);\n\t}",
"class_method_signature": "Line.copy()",
"constructor": false,
"full_signature": "@Overri... | {
"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_222 | {
"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 ofDeg()\n\t{\n\t\tassertEquals(0, Angle.ofDeg(0).asRad(), ACCURACY);\n\t\tassertEquals(0, Angle.ofDeg(360).asRad(), ACCURACY);\n\t\tassertEquals(Math.PI / 2, Angle.ofDeg(90).asRad(), ACCURACY);\n\t\tassertEquals(Math.PI / 2, Angle.ofDeg(-270).asRad(), ACCURACY);\n\t}",
"class_method_... | {
"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": "public static Angle ofDeg(double deg)\n\t{\n\t\treturn new Angle(deg2rad(deg));\n\t}",
"class_method_signature": "Angle.ofDeg(double deg)",
"constructor": false,
"full_signature": "public static Angle ofDeg(double deg)",
"identifier": "ofDeg",
"invocations": [
"deg2rad"
],
"modifiers": "p... | {
"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_96 | {
"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\tVector2 vec1 = Vector2.fromXY(5, 0);\n\t\tVector2 vec2 = Vector2.fromXY(5, 0);\n\t\tBoolean result = vec1.equals(vec2);\n\t\tassertTrue(result);\n\t\t\n\t\tvec1 = Vector2.fromXY(3.1f, 1.4);\n\t\tvec2 = Vector2.fromXY(3.1f, 1.4);\n\t\tresult = vec1.equals(vec2);\n... | {
"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_79 | {
"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 testToJSON()\n\t{\n\t\tassertThat(VectorN.from(42, 1337, 1).toJSON().toJSONString())\n\t\t\t\t.isEqualTo(\"{\\\"dim2\\\":1.0,\\\"dim1\\\":1337.0,\\\"dim0\\\":42.0}\");\n\t}",
"class_method_signature": "VectorNTest.testToJSON()",
"constructor": false,
"full_signature": "@Test publ... | {
"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_80 | {
"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 testToJSONArray()\n\t{\n\t\tassertThat(VectorN.from(42, 1337, 1).toJSONArray().toJSONString()).isEqualTo(\"[42.0,1337.0,1.0]\");\n\t}",
"class_method_signature": "VectorNTest.testToJSONArray()",
"constructor": false,
"full_signature": "@Test public void testToJSONArray()",
"ide... | {
"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_234 | {
"fields": [],
"file": "modules/common/src/test/java/edu/tigers/sumatra/filter/DataSyncTest.java",
"identifier": "DataSyncTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void add()\n\t{\n\t\tDataSync<Data> ds = new DataSync<>(10);\n\t\tds.add(1, new Data(10.0));\n\t\tds.add(3, new Data(20.0));\n\t\tds.add(5, new Data(30.0));\n\n\t\tassertThat(ds.get(0)).isNotPresent();\n\t\tassertThat(ds.get(1)).isPresent();\n\t\tassertThat(ds.get(2)).isPresent();\n\t\tasse... | {
"fields": [
{
"declarator": "log = LogManager.getLogger(DataSync.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger log = LogManager.getLogger(DataSync.class.getName());",
"type": "Logger",
"var_name": "log"
},
{
"de... | {
"body": "public synchronized void add(final long timestamp, final T data)\n\t{\n\t\tDataStore store = new DataStore(timestamp, data);\n\t\tif (!buffer.isEmpty() && timestamp < buffer.get(0).getTimestamp())\n\t\t{\n\t\t\tlog.debug(\"Clearing buffer, since incoming timestamp is smaller than buffered timestamp ({} < {... | {
"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_38 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/rectangle/RectangleTest.java",
"identifier": "RectangleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testNearestPointOutside()\n\t{\n\t\tRectangle rect = Rectangle.fromCenter(Vector2.zero(), 4, 4);\n\t\t\n\t\tassertThat(rect.nearestPointOutside(Vector2.fromXY(1, 0))).isEqualTo(Vector2.fromXY(2, 0));\n\t\tassertThat(rect.nearestPointOutside(Vector2.fromXY(-1, 0))).isEqualTo(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_43 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/rectangle/RectangleTest.java",
"identifier": "RectangleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testMaxY()\n\t{\n\t\tRectangle rect = Rectangle.fromCenter(Vector2.zero(), 42, 42);\n\t\tassertThat(rect.maxY()).isEqualTo(21);\n\t\t\n\t\trect = Rectangle.fromCenter(Vector2.fromXY(1, 1), 42, 42);\n\t\tassertThat(rect.maxY()).isEqualTo(22);\n\t}",
"class_method_signature": "Rectangl... | {
"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_166 | {
"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 testToLine()\n\t{\n\t\tIHalfLine halfLine = HalfLine.fromDirection(Vector2f.ZERO_VECTOR, Vector2f.Y_AXIS);\n\t\tILine line = halfLine.toLine();\n\t\t\n\t\tassertThat(halfLine.supportVector(), is(line.supportVector()));\n\t\t\n\t\tassertThat(halfLine.directionVector().isParallelTo(line.... | {
"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 ILine toLine()\n\t{\n\t\treturn Line.createNewWithoutCopy(supportVector(), directionVector());\n\t}",
"class_method_signature": "HalfLine.toLine()",
"constructor": false,
"full_signature": "@Override public ILine toLine()",
"identifier": "toLine",
"invocations": [
"createN... | {
"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_189 | {
"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 testFromPoints()\n\t{\n\t\tIVector2 a = Vector2.fromXY(0, 0);\n\t\tIVector2 b = Vector2.fromXY(1, 1);\n\t\tIVector2 aToB = b.subtractNew(a);\n\t\t\n\t\tILine line = Line.fromPoints(a, b);\n\t\t\n\t\t/*\n\t\t * The support vector should be equal to vector a\n\t\t */\n\t\tassertEquals(li... | {
"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 fromPoints(final IVector2 supportPointA, final IVector2 supportPointB)\n\t{\n\t\treturn createNewFromVectorCopy(supportPointA, supportPointB.subtractNew(supportPointA));\n\t}",
"class_method_signature": "Line.fromPoints(final IVector2 supportPointA, final IVector2 supportPointB)",
"... | {
"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_218 | {
"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 subtract()\n\t{\n\t\tassertEquals(-2 * Math.PI, Rotation.zero().subtract(Math.PI / 2).subtract(Rotation.ofDeg(270)).asRad(), ACCURACY);\n\t\tassertEquals(-3, Rotation.zero().subtract(Rotation.ofDeg(1)).subtract(Rotation.ofDeg(2)).asDeg(), ACCURACY);\n\t}",
"class_method_signature": "... | {
"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": "@Override\n\tpublic IRotation subtract(final IAngularMeasure angle)\n\t{\n\t\treturn subtract(angle.asRad());\n\t}",
"class_method_signature": "Rotation.subtract(final IAngularMeasure angle)",
"constructor": false,
"full_signature": "@Override public IRotation subtract(final IAngularMeasure angle)",
... | {
"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_131 | {
"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 testToString()\n\t{\n\t\tIVector3 vector1 = Vector3.fromXYZ(0, 0, 2.5);\n\t\tassertThat(vector1.toString()).isEqualTo(\"[0.000,0.000,2.500|l=2.500]\");\n\t\tIVector3 vector2 = Vector3.fromXYZ(0, 0.001, 0);\n\t\tassertThat(vector2.toString()).isEqualTo(\"[0.000,0.001,0.000|l=0.001]\");\... | {
"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_14 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/circle/CircleMathTest.java",
"identifier": "CircleMathTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void isPointInArc180degStart90deg()\n\t{\n\t\tdouble radius = 300;\n\t\tdouble margin = 0.0;\n\t\tdouble start = AngleMath.PI_HALF;\n\t\tdouble rotation = AngleMath.PI;\n\t\tIVector2 center = Vector2.fromXY(500, 500);\n\t\tIArc arc = Arc.createArc(center, radius, start, rotation);\n\t\tasse... | {
"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_127 | {
"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(Vector3.fromXYZ(0, 1, 2).isFinite()).isTrue();\n\t\tassertThat(Vector3.fromXYZ(Double.NaN, 0, 0).isFinite()).isFalse();\n\t\tassertThat(Vector3.fromXYZ(Double.POSITIVE_INFINITY, 0, 0).isFinite()).isFalse();\n\t}",
"class_method_signature": "Vector3... | {
"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_170 | {
"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 testDistanceTo()\n\t{\n\t\tIVector2 sV = Vector2f.ZERO_VECTOR;\n\t\tIVector2 dV = Vector2f.Y_AXIS;\n\t\tIHalfLine line = HalfLine.fromDirection(sV, dV);\n\t\tIHalfLine invalidLine = HalfLine.fromDirection(sV, Vector2f.ZERO_VECTOR);\n\t\t\n\t\tfor (int i = -10; i <= 10; i += 1)\n\t\t{\n... | {
"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_55 | {
"fields": [
{
"declarator": "ACCURACY\t= 0.001",
"modifier": "private static final",
"original_string": "private static final double\tACCURACY\t= 0.001;",
"type": "double",
"var_name": "ACCURACY"
}
],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/AngleM... | {
"body": "@Test\n\tpublic void testDeg2Rad()\n\t{\n\t\tassertThat(AngleMath.deg2rad(-360)).isCloseTo(-AngleMath.PI_TWO, withinPercentage(0.1));\n\t\tassertThat(AngleMath.deg2rad(-180)).isCloseTo(-AngleMath.PI, withinPercentage(0.1));\n\t\tassertThat(AngleMath.deg2rad(-90)).isCloseTo(-AngleMath.PI_HALF, withinPercent... | {
"fields": [
{
"declarator": "PI = Math.PI",
"modifier": "public static final",
"original_string": "public static final double PI = Math.PI;",
"type": "double",
"var_name": "PI"
},
{
"declarator": "PI_TWO = Math.PI * 2.0",
"modifier": "public static final",
... | {
"body": "public static double deg2rad(final double deg)\n\t{\n\t\treturn DEG_TO_RAD * deg;\n\t}",
"class_method_signature": "AngleMath.deg2rad(final double deg)",
"constructor": false,
"full_signature": "public static double deg2rad(final double deg)",
"identifier": "deg2rad",
"invocations": [],
"modifi... | {
"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_171 | {
"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 testSegmentFromPoints()\n\t{\n\t\tIVector2 a = Vector2.fromXY(1, 2);\n\t\tIVector2 b = Vector2.fromXY(6, 3);\n\t\t\n\t\tILineSegment lineA = LineSegment.fromPoints(a, b);\n\t\tILineSegment lineB = Lines.segmentFromPoints(a, b);\n\t\tassertThat(lineA, is(lineB));\n\t}",
"class_method_... | {
"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 ILineSegment segmentFromPoints(final IVector2 start, final IVector2 end)\n\t{\n\t\treturn LineSegment.fromPoints(start, end);\n\t}",
"class_method_signature": "Lines.segmentFromPoints(final IVector2 start, final IVector2 end)",
"constructor": false,
"full_signature": "public static ILin... | {
"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_54 | {
"fields": [
{
"declarator": "ACCURACY\t= 0.001",
"modifier": "private static final",
"original_string": "private static final double\tACCURACY\t= 0.001;",
"type": "double",
"var_name": "ACCURACY"
}
],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/AngleM... | {
"body": "@Test\n\tpublic void testDifference()\n\t{\n\t\tassertThat(AngleMath.difference(1, 2)).isEqualTo(-1.0);\n\t\tassertThat(AngleMath.difference(2, 1)).isEqualTo(1.0);\n\t\tassertThat(AngleMath.difference(50, 10)).isEqualTo(AngleMath.normalizeAngle(40));\n\t\tassertThat(AngleMath.difference(50, 48)).isEqualTo(... | {
"fields": [
{
"declarator": "PI = Math.PI",
"modifier": "public static final",
"original_string": "public static final double PI = Math.PI;",
"type": "double",
"var_name": "PI"
},
{
"declarator": "PI_TWO = Math.PI * 2.0",
"modifier": "public static final",
... | {
"body": "public static double difference(final double angle1, final double angle2)\n\t{\n\t\treturn normalizeAngle(angle1 - angle2);\n\t}",
"class_method_signature": "AngleMath.difference(final double angle1, final double angle2)",
"constructor": false,
"full_signature": "public static double difference(final... | {
"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_126 | {
"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 testIsZeroVector()\n\t{\n\t\tassertThat(Vector3.fromXYZ(0, 0, 0).isZeroVector()).isTrue();\n\t\tassertThat(Vector3.fromXYZ(1e-8, 0, 0).isZeroVector()).isTrue();\n\t\tassertThat(Vector3.fromXYZ(1e-8, 1e-8, 1e-8).isZeroVector()).isTrue();\n\t\tassertThat(Vector3.fromXYZ(1e-2, 0, 0).isZer... | {
"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_130 | {
"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 testToArray()\n\t{\n\t\tIVector3 vector = Vector3.fromXYZ(42, 1337, 3.14);\n\t\tassertThat(vector.toArray()).isEqualTo(new double[] { 42d, 1337d, 3.14 });\n\t}",
"class_method_signature": "Vector3Test.testToArray()",
"constructor": false,
"full_signature": "@Test public void test... | {
"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_15 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/circle/CircleMathTest.java",
"identifier": "CircleMathTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void isPointInArc180degStartMinus90deg()\n\t{\n\t\tdouble radius = 300;\n\t\tdouble margin = 0.0;\n\t\tdouble start = -AngleMath.PI_HALF;\n\t\tdouble rotation = AngleMath.PI;\n\t\tIVector2 center = Vector2.fromXY(-500, -500);\n\t\tIArc arc = Arc.createArc(center, radius, start, rotation);\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 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_219 | {
"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 multiply()\n\t{\n\t\tassertEquals(0, Rotation.zero().multiply(Math.PI / 2).multiply(42).asRad(), ACCURACY);\n\t\tassertEquals(42, Rotation.ofDeg(21).multiply(1).multiply(2).asDeg(), ACCURACY);\n\t}",
"class_method_signature": "RotationTest.multiply()",
"constructor": false,
"full... | {
"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": "@Override\n\tpublic IRotation multiply(final double factor)\n\t{\n\t\treturn new Rotation(this.angle * factor);\n\t}",
"class_method_signature": "Rotation.multiply(final double factor)",
"constructor": false,
"full_signature": "@Override public IRotation multiply(final double factor)",
"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_42 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/rectangle/RectangleTest.java",
"identifier": "RectangleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testMaxX()\n\t{\n\t\tRectangle rect = Rectangle.fromCenter(Vector2.zero(), 42, 42);\n\t\tassertThat(rect.maxX()).isEqualTo(21);\n\t\t\n\t\trect = Rectangle.fromCenter(Vector2.fromXY(1, 1), 42, 42);\n\t\tassertThat(rect.maxX()).isEqualTo(22);\n\t}",
"class_method_signature": "Rectangl... | {
"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_167 | {
"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 testIntersectHalfLine()\n\t{\n\t\tIHalfLine lineA = HalfLine.fromDirection(Vector2f.ZERO_VECTOR, Vector2f.X_AXIS);\n\t\t\n\t\tIVector2 sV = Vector2.fromXY(0, 1);\n\t\tIVector2 dV = Vector2f.X_AXIS;\n\t\tfor (int degAngle = 0; degAngle < 360; degAngle++)\n\t\t{\n\t\t\tdouble radAngle = ... | {
"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 Optional<IVector2> intersectHalfLine(final IHalfLine other)\n\t{\n\t\tif (this.isValid() && other.isValid())\n\t\t{\n\t\t\treturn LineMath.intersectionPointOfHalfLines(this, other);\n\t\t}\n\t\treturn Optional.empty();\n\t}",
"class_method_signature": "HalfLine.intersectHalfLine(final... | {
"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_188 | {
"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 testStepAlongLine()\n\t{\n\t\tIVector2 start = Vector2.fromXY(5, 12);\n\t\tIVector2 end = Vector2.fromXY(30, 400);\n\t\tILineSegment segment = LineSegment.fromPoints(start, end);\n\t\t\n\t\tIVector2 displacement = end.subtractNew(start);\n\t\tfor (int stepSize = -10000; stepSize <= 100... | {
"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 IVector2 stepAlongLine(final double stepSize)\n\t{\n\t\tif (!isValid())\n\t\t{\n\t\t\treturn getStart();\n\t\t}\n\t\treturn LineMath.stepAlongLine(getStart(), getEnd(), stepSize);\n\t}",
"class_method_signature": "LineSegment.stepAlongLine(final double stepSize)",
"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_39 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/rectangle/RectangleTest.java",
"identifier": "RectangleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testNearestPointInside()\n\t{\n\t\tIRectangle rect = Rectangle.fromCenter(Vector2.zero(), 8, 8);\n\t\t\n\t\tassertThat(rect.nearestPointInside(Vector2.fromXY(0, 0))).isEqualTo(Vector2.fromXY(0, 0));\n\t\tassertThat(rect.nearestPointInside(Vector2.fromXY(5, 4))).isEqualTo(Vector2.fromXY... | {
"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_235 | {
"fields": [
{
"declarator": "NUMBER_OF_TESTS = 10000",
"modifier": "private static final",
"original_string": "private static final int NUMBER_OF_TESTS = 10000;",
"type": "int",
"var_name": "NUMBER_OF_TESTS"
},
{
"declarator": "POS_LIMIT = 10.0",
"modifier": "pr... | {
"body": "@Test\n\tpublic void testGetMinimumDistanceSimple()\n\t{\n\t\tIVector2 initialPos = Vector2.fromXY(0, 0);\n\t\tIVector2 finalPos = Vector2.fromXY(3, 0);\n\t\tIVector2 initialVel = Vector2f.ZERO_VECTOR;\n\t\t\n\t\tIVector2 testPoint = Vector2.fromXY(1.5, 1);\n\t\t\n\t\tBangBangTrajectory2D traj = new BangBa... | {
"fields": [
{
"declarator": "segments",
"modifier": "private final",
"original_string": "private final List<PlanarCurveSegment> segments;",
"type": "List<PlanarCurveSegment>",
"var_name": "segments"
}
],
"file": "modules/common/src/main/java/edu/tigers/sumatra/planarcurve/P... | {
"body": "public double getMinimumDistanceToPoint(final IVector2 point)\n\t{\n\t\treturn getMinimumDistanceToCurve(PlanarCurve.fromPoint(point));\n\t}",
"class_method_signature": "PlanarCurve.getMinimumDistanceToPoint(final IVector2 point)",
"constructor": false,
"full_signature": "public double getMinimumDist... | {
"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_81 | {
"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 testGet()\n\t{\n\t\tIVectorN vector = VectorN.from(42, 1337, 2);\n\t\tassertThat(vector.get(0)).isEqualTo(vector.x());\n\t\tassertThat(vector.get(1)).isEqualTo(vector.y());\n\t\tassertThatThrownBy(() -> vector.get(3)).isExactlyInstanceOf(IllegalArgumentException.class);\n\t}",
"class... | {
"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": "@Override\n\tpublic double get(final int i)\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\treturn data[i];\n\t}",
"class_method_signature": "VectorN.get(final int i)",
"constructor": false,
"full_signature": "@Override p... | {
"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_97 | {
"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 testFromAngle()\n\t{\n\t\tassertThat(Vector2.fromAngle(1).getAngle()).isEqualTo(1, within(ACCURACY));\n\t\tassertThat(Vector2.fromAngle(-1).getAngle()).isEqualTo(-1, within(ACCURACY));\n\t\tassertThat(Vector2.fromAngle(AngleMath.PI).getAngle()).isCloseTo(AngleMath.PI, within(ACCURACY))... | {
"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 fromAngle(final double angle)\n\t{\n\t\tfinal double yn = SumatraMath.sin(angle);\n\t\tfinal double xn = SumatraMath.cos(angle);\n\t\treturn Vector2.fromXY(xn, yn);\n\t}",
"class_method_signature": "Vector2.fromAngle(final double angle)",
"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_78 | {
"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 testToString()\n\t{\n\t\tIVectorN vector1 = VectorN.from(0, 0, 2.5);\n\t\tassertThat(vector1.toString()).isEqualTo(\"[0.000,0.000,2.500|l=2.500]\");\n\t\tIVectorN vector2 = VectorN.from(0, 0.001, 0);\n\t\tassertThat(vector2.toString()).isEqualTo(\"[0.000,0.001,0.000|l=0.001]\");\n\t\tI... | {
"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_223 | {
"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 ofRotation()\n\t{\n\t\tassertEquals(0, Angle.ofRotation(5).asRad(), ACCURACY);\n\t\tassertEquals(-Math.PI, Angle.ofRotation(0.5).asRad(), ACCURACY);\n\t\tassertEquals(-Math.PI / 2, Angle.ofRotation(-0.25).asRad(), ACCURACY);\n\t}",
"class_method_signature": "AngleTest.ofRotation()",
... | {
"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": "public static Angle ofRotation(double turns)\n\t{\n\t\treturn new Angle(rot2rad(turns));\n\t}",
"class_method_signature": "Angle.ofRotation(double turns)",
"constructor": false,
"full_signature": "public static Angle ofRotation(double turns)",
"identifier": "ofRotation",
"invocations": [
"rot... | {
"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_254 | {
"fields": [],
"file": "modules/moduli-cam/src/test/java/edu/tigers/sumatra/cam/data/CamCalibrationTest.java",
"identifier": "CamCalibrationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void cameraToWorldTest()\n\t{\n\t\tCamCalibration cam = getCamera();\n\t\t\n\t\tIVector3 pos = cam.getCameraPosition();\n\t\t\n\t\tAssert.assertTrue(pos.isCloseTo(getKnownDerivedCameraWorld(), 1.0));\n\t}",
"class_method_signature": "CamCalibrationTest.cameraToWorldTest()",
"constructor... | {
"fields": [
{
"declarator": "cameraId",
"modifier": "private final",
"original_string": "private final int cameraId;",
"type": "int",
"var_name": "cameraId"
},
{
"declarator": "focalLength",
"modifier": "private final",
"original_string": "private final do... | {
"body": "public IVector3 getCameraPosition()\n\t{\n\t\treturn cameraPosition;\n\t}",
"class_method_signature": "CamCalibration.getCameraPosition()",
"constructor": false,
"full_signature": "public IVector3 getCameraPosition()",
"identifier": "getCameraPosition",
"invocations": [],
"modifiers": "public",... | {
"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_58 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/polygon/PolygonTest.java",
"identifier": "PolygonTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testNearestPointOutside()\n\t{\n\t\t\n\t\tPolygonBuilder b = new PolygonBuilder();\n\t\tb.addPoint(Vector2.fromXY(-1, -1));\n\t\tb.addPoint(Vector2.fromXY(1, -1));\n\t\tb.addPoint(Vector2.fromXY(1, 1));\n\t\tb.addPoint(Vector2.fromXY(-1, 1));\n\t\tPolygon p = b.build();\n\t\t\n\t\t// n... | {
"fields": [
{
"declarator": "points",
"modifier": "private final",
"original_string": "private final IVector2[]\t\tpoints;",
"type": "IVector2[]",
"var_name": "points"
},
{
"declarator": "centroid",
"modifier": "private final",
"original_string": "private ... | {
"body": "@Override\n\tpublic IVector2 nearestPointOutside(final IVector2 point)\n\t{\n\t\treturn nearestPointOutside(point, 0);\n\t}",
"class_method_signature": "Polygon.nearestPointOutside(final IVector2 point)",
"constructor": false,
"full_signature": "@Override public IVector2 nearestPointOutside(final IVe... | {
"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_0 | {
"fields": [],
"file": "modules/common-bot/src/test/java/edu/tigers/sumatra/bot/StateTest.java",
"identifier": "StateTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void interpolate()\n\t{\n\t\tState state1 = State.of(Pose.zero(), Vector3.fromXYZ(2, 10, 0));\n\t\tState state2 = State.of(Pose.zero(), Vector3.fromXYZ(4, 12, 2));\n\t\tassertThat(state1.interpolate(state2, 0.0)).isEqualTo(state1);\n\t\tassertThat(state2.interpolate(state1, 0.0)).isEqualTo(... | {
"fields": [
{
"declarator": "pose",
"modifier": "private final",
"original_string": "private final Pose pose;",
"type": "Pose",
"var_name": "pose"
},
{
"declarator": "vel3",
"modifier": "private final",
"original_string": "private final IVector3 vel3;",
... | {
"body": "@Override\n\tpublic State interpolate(final State state, double percentage)\n\t{\n\t\tIVector3 velDiff = state.vel3.subtractNew(vel3).multiply(percentage);\n\t\tIVector3 intpVel = vel3.addNew(velDiff);\n\t\treturn State.of(pose.interpolate(state.pose, percentage), intpVel);\n\t}",
"class_method_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_192 | {
"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 testNewWithoutCopy()\n\t{\n\t\tIVector2 sV = Vector2.fromXY(1, 2);\n\t\tIVector2 positiveDV = Vector2.fromAngle(1.5d);\n\t\tIVector2 negativeDV = Vector2.fromAngle(-1.5d);\n\t\t\n\t\tILine posLine = Line.createNewWithoutCopy(sV, positiveDV);\n\t\t\n\t\tassertThat(posLine.supportVector(... | {
"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": "static ILine createNewWithoutCopy(final IVector2 supportVector, final IVector2 directionVector)\n\t{\n\t\tIVector2 dV = directionVector;\n\t\tif (dV.getAngle(0.0d) < 0.0d)\n\t\t{\n\t\t\tdV = dV.multiplyNew(-1.0d);\n\t\t}\n\t\t\n\t\treturn new Line(supportVector, dV);\n\t}",
"class_method_signature": "Lin... | {
"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_203 | {
"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 testDistancePL()\n\t{\n\t\tList<ILine> lines = new ArrayList<>();\n\t\tList<Double> idx = new ArrayList<>();\n\t\tfor (double i = 0; i < (2 * Math.PI); i += 0.1)\n\t\t{\n\t\t\tidx.add(i);\n\t\t\tfinal double spiralCoeff = i + 1e-3;\n\t\t\tIVector2 p2 = Vector2.fromXY(spiralCoeff * Suma... | {
"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 double distancePL(final IVector2 point, final ILine line)\n\t{\n\t\treturn VectorMath.distancePP(point, leadPointOnLine(line, point));\n\t}",
"class_method_signature": "LineMath.distancePL(final IVector2 point, final ILine line)",
"constructor": false,
"full_signature": "public static 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_215 | {
"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 ofRotation()\n\t{\n\t\tassertEquals(10 * Math.PI, Rotation.ofRotation(5).asRad(), ACCURACY);\n\t\tassertEquals(Math.PI, Rotation.ofRotation(0.5).asRad(), ACCURACY);\n\t\tassertEquals(-Math.PI / 2, Rotation.ofRotation(-0.25).asRad(), ACCURACY);\n\t}",
"class_method_signature": "Rotati... | {
"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 ofRotation(double turns)\n\t{\n\t\treturn new Rotation(rot2rad(turns));\n\t}",
"class_method_signature": "Rotation.ofRotation(double turns)",
"constructor": false,
"full_signature": "public static Rotation ofRotation(double turns)",
"identifier": "ofRotation",
"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_19 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/circle/CircleMathTest.java",
"identifier": "CircleMathTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void isPointInArcMinus90degStart180deg()\n\t{\n\t\tdouble radius = 300;\n\t\tdouble margin = 0.0;\n\t\tdouble start = AngleMath.PI;\n\t\tdouble rotation = -AngleMath.PI_HALF;\n\t\tIVector2 center = Vector2.fromXY(1000, -100);\n\t\tIArc arc = Arc.createArc(center, radius, start, rotation);\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 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_242 | {
"fields": [],
"file": "modules/moduli-referee/src/test/java/edu/tigers/sumatra/referee/gameevent/GameEventFactoryTest.java",
"identifier": "GameEventFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testFromProtobuf()\n\t{\n\t\tList<IGameEvent> gameEvents = new ArrayList<>();\n\t\tgameEvents.add(new AimlessKick(botId(), location(), location()));\n\t\tgameEvents.add(new AttackerDoubleTouchedBall(botId(), location()));\n\t\tgameEvents.add(new AttackerTouchedBallInDefenseArea(botId()... | {
"fields": [
{
"declarator": "log = LogManager.getLogger(GameEventFactory.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger log = LogManager.getLogger(GameEventFactory.class.getName());",
"type": "Logger",
"var_name": "log"
}
... | {
"body": "public static Optional<IGameEvent> fromProtobuf(SslGcGameEvent.GameEvent event)\n\t{\n\t\tif (event.getType() == SslGcGameEvent.GameEvent.Type.UNKNOWN_GAME_EVENT_TYPE)\n\t\t{\n\t\t\treturn Optional.empty();\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tfinal EGameEvent gameEvent = EGameEvent.fromProto(event.getType());\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_184 | {
"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 testIntersectHalfLine()\n\t{\n\t\tIHalfLine halfLine = HalfLine.fromDirection(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.intersectHalfLine(halfLine);\n\t\t\tif (de... | {
"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> intersectHalfLine(final IHalfLine halfLine)\n\t{\n\t\treturn halfLine.intersectSegment(this);\n\t}",
"class_method_signature": "LineSegment.intersectHalfLine(final IHalfLine halfLine)",
"constructor": false,
"full_signature": "@Override public Optional<IVector2>... | {
"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_239 | {
"fields": [
{
"declarator": "NUMBER_OF_TESTS = 10000",
"modifier": "private static final",
"original_string": "private static final int NUMBER_OF_TESTS = 10000;",
"type": "int",
"var_name": "NUMBER_OF_TESTS"
},
{
"declarator": "POS_LIMIT = 10.0",
"modifier": "pr... | {
"body": "@Test\n\tpublic void testLineTrajIntersectionSimple()\n\t{\n\t\tIVector2 initialPos1 = Vector2.fromXY(-3, 0);\n\t\tIVector2 finalPos1 = Vector2.fromXY(3, 0);\n\t\tIVector2 initialVel1 = Vector2.fromXY(0, 0);\n\t\t\n\t\tIVector2 initialPos2 = Vector2.fromXY(0, -2000);\n\t\tIVector2 finalPos2 = Vector2.fromX... | {
"fields": [
{
"declarator": "segments",
"modifier": "private final",
"original_string": "private final List<PlanarCurveSegment> segments;",
"type": "List<PlanarCurveSegment>",
"var_name": "segments"
}
],
"file": "modules/common/src/main/java/edu/tigers/sumatra/planarcurve/P... | {
"body": "public List<IVector2> getIntersectionsWithLineSegment(final ILine line)\n\t{\n\t\tList<IVector2> intersections = new ArrayList<>();\n\t\t\n\t\tPlanarCurveSegment lineSegment = PlanarCurveSegment.fromFirstOrder(line.supportVector(), line.directionVector(),\n\t\t\t\t0, 1.0);\n\t\t\n\t\tfor (PlanarCurveSegmen... | {
"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_110 | {
"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 testGetNormalVector()\n\t{\n\t\tassertThat(Vector2.fromXY(1, 0).getNormalVector()).isEqualTo(Vector2.fromXY(0, -1));\n\t\tassertThat(Vector2.fromXY(1, 1).getNormalVector()).isEqualTo(Vector2.fromXY(1, -1));\n\t\tassertThat(Vector2.fromXY(0, 1).getNormalVector()).isEqualTo(Vector2.fromX... | {
"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_35 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/rectangle/RectangleTest.java",
"identifier": "RectangleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testFromCenter()\n\t{\n\t\tIVector2 p1 = Vector2.fromXY(-7, -13);\n\t\tIRectangle baseRect = Rectangle.fromCenter(p1, 10, 20);\n\t\t\n\t\tassertThat(baseRect.xExtent()).isCloseTo(10, Percentage.withPercentage(0.1));\n\t\tassertThat(baseRect.yExtent()).isCloseTo(20, Percentage.withPerce... | {
"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_62 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Vector2fTest.java",
"identifier": "Vector2fTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testZero()\n\t{\n\t\tVector2f zero = Vector2f.zero();\n\t\tassertThat(zero.x()).isEqualTo(0.0);\n\t\tassertThat(zero.y()).isEqualTo(0.0);\n\t}",
"class_method_signature": "Vector2fTest.testZero()",
"constructor": false,
"full_signature": "@Test public void testZero()",
"identif... | {
"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 zero()\n\t{\n\t\treturn new Vector2f();\n\t}",
"class_method_signature": "Vector2f.zero()",
"constructor": false,
"full_signature": "public static Vector2f 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_147 | {
"fields": [
{
"declarator": "converter = new VectorConverter()",
"modifier": "private",
"original_string": "private VectorConverter converter = new VectorConverter();",
"type": "VectorConverter",
"var_name": "converter"
}
],
"file": "modules/common-math/src/test/java/edu/ti... | {
"body": "@Test\n\tpublic void testParseString()\n\t{\n\t\tassertThat(converter.parseString(IVector.class, \"42;1337\")).isEqualTo(Vector2.fromXY(42, 1337));\n\t\tassertThat(converter.parseString(IVector2.class, \"42;1337\")).isEqualTo(Vector2.fromXY(42, 1337));\n\t\tassertThat(converter.parseString(IVector3.class, ... | {
"fields": [
{
"declarator": "log = LogManager.getLogger(VectorConverter.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger log = LogManager.getLogger(VectorConverter.class.getName());",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "@Override\n\tpublic Object parseString(final Class<?> impl, final String value)\n\t{\n\t\tif (impl.equals(IVector2.class))\n\t\t{\n\t\t\treturn parseVector2(value);\n\t\t} else if (impl.equals(IVector3.class))\n\t\t{\n\t\t\treturn parseVector3(value);\n\t\t} else if (impl.equals(IVectorN.class) || impl.equ... | {
"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_151 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/SumatraMathTest.java",
"identifier": "SumatraMathTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testIsBetween()\n\t{\n\t\tAssert.assertEquals(true, SumatraMath.isBetween(-2, -10, 0));\n\t\tAssert.assertEquals(true, SumatraMath.isBetween(5, -10, 10));\n\t\tAssert.assertEquals(false, SumatraMath.isBetween(-20, -10, 10));\n\t\tAssert.assertEquals(false, SumatraMath.isBetween(15, -10... | {
"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 isBetween(final double x, final double min, final double max)\n\t{\n\t\tboolean result;\n\t\tif (max > min)\n\t\t{\n\t\t\tresult = (x >= min) && (x <= max);\n\t\t} else\n\t\t{\n\t\t\tresult = (x >= max) && (x <= min);\n\t\t}\n\t\t\n\t\treturn result;\n\t}",
"class_method_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_74 | {
"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(VectorN.from(0, 1, 2).isFinite()).isTrue();\n\t\tassertThat(VectorN.from(Double.NaN, 0, 0).isFinite()).isFalse();\n\t\tassertThat(VectorN.from(Double.POSITIVE_INFINITY, 0, 0).isFinite()).isFalse();\n\t}",
"class_method_signature": "VectorNTest.test... | {
"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_23 | {
"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 testIsLineIntersectingShape()\n\t{\n\t\t// Test true\n\t\tICircle circle = Circle.createCircle(Vector2.fromXY(1, 1), 1);\n\t\tLine line = Line.fromDirection(Vector2.fromXY(0, 0), Vector2.fromXY(1, 1));\n\t\tAssert.assertEquals(true, circle.isIntersectingWithLine(line));\n\t\t\n\t\t// 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 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_106 | {
"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 testToString()\n\t{\n\t\tIVector2 vector1 = Vector2.fromXY(42, 0);\n\t\tassertThat(vector1.toString()).isEqualTo(\"[42.000,0.000|l=42.000|a=0.000]\");\n\t\tIVector2 vector2 = Vector2.fromXY(0, 0.001);\n\t\tassertThat(vector2.toString()).isEqualTo(\"[0.000,0.001|l=0.001]\");\n\t\tIVecto... | {
"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_224 | {
"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 ofVec()\n\t{\n\t\tassertEquals(0, Angle.ofVec(Vector2.fromAngle(0)).asRad(), ACCURACY);\n\t\tassertEquals(-1.982297, Angle.ofVec(Vector2.fromAngle(42)).asRad(), ACCURACY);\n\t\tassertEquals(Math.PI / 2, Angle.ofVec(Vector2.fromAngle(Math.PI / 2)).asRad(), ACCURACY);\n\t}",
"class_met... | {
"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": "public static Angle ofVec(IVector2 vector)\n\t{\n\t\treturn new Angle(vector.getAngle());\n\t}",
"class_method_signature": "Angle.ofVec(IVector2 vector)",
"constructor": false,
"full_signature": "public static Angle ofVec(IVector2 vector)",
"identifier": "ofVec",
"invocations": [
"getAngle"
... | {
"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_28 | {
"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 testHullCircle()\n\t{\n\t\tList<IVector2> points = new ArrayList<>();\n\t\tpoints.add(Vector2.fromXY(1, 0));\n\t\tpoints.add(Vector2.fromXY(-1, 0));\n\t\tpoints.add(Vector2.fromXY(0, 0.5));\n\t\tpoints.add(Vector2.fromXY(0, -0.5));\n\t\t\n\t\tICircle circle = Circle.hullCircle(points).... | {
"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_90 | {
"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 testSubtractNew()\n\t{\n\t\tVector2 vec1 = Vector2.fromXY(5, 7);\n\t\tVector2 vec2 = Vector2.fromXY(1, 2);\n\t\tVector2 result = vec1.subtractNew(vec2);\n\t\tassertEquals(Vector2.fromXY(4, 5), result);\n\t\t\n\t\tvec1 = Vector2.fromXY(-3, 0);\n\t\tvec2 = Vector2.fromXY(4, 2);\n\t\tresu... | {
"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_86 | {
"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\tVector2 vec1 = Vector2.fromXY(2, 1);\n\t\tVector2 vec2 = Vector2.fromXY(3, 4);\n\t\t\n\t\tvec1.add(vec2);\n\t\tassertEquals(Vector2.fromXY(5, 5), vec1);\n\t\t\n\t\tvec1 = Vector2.fromXY(-2, 0);\n\t\tvec1.add(vec2);\n\t\tassertEquals(Vector2.fromXY(1, 4), vec1);\n\t\... | {
"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 add(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.add(final IVector vector)",
"constructor": false,
"full_signature": "public Vector2 add(final IVector vector)",
"identifier": "add",
... | {
"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_69 | {
"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 testSubtractNew()\n\t{\n\t\tVectorN vec1 = VectorN.from(5, 7, 2);\n\t\tVectorN vec2 = VectorN.from(1, 2, -1);\n\t\tVectorN result = vec1.subtractNew(vec2);\n\t\tassertEquals(VectorN.from(4, 5, 3), result);\n\t\t\n\t\tvec1 = VectorN.from(-3, 0, 1);\n\t\tvec2 = VectorN.from(4, 2, 1);\n\t... | {
"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_232 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/StatisticsMathTest.java",
"identifier": "StatisticsMathTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testStd()\n\t{\n\t\tAssertions.assertThat(StatisticsMath.std(Arrays.asList(12, 19, 42, 1337))).isCloseTo(\n\t\t\t\tSumatraMath.sqrt(StatisticsMath.variance(Arrays.asList(12, 19, 42, 1337))),\n\t\t\t\tAssertions.withinPercentage(0.01));\n\t}",
"class_method_signature": "StatisticsMath... | {
"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 std(final List<T> values)\n\t{\n\t\treturn SumatraMath.sqrt(variance(values));\n\t}",
"class_method_signature": "StatisticsMath.std(final List<T> values)",
"constructor": false,
"full_signature": "public static double std(final List<T> values)",
"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_249 | {
"fields": [],
"file": "modules/moduli-geometry/src/test/java/edu/tigers/sumatra/geometry/NGeometryTest.java",
"identifier": "NGeometryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testBallInsideGoal()\n\t{\n\t\tIRectangle field = Geometry.getField();\n\t\tassertFalse(NGeometry.ballInsideGoal(Vector3.zero()));\n\t\tassertTrue(NGeometry.ballInsideGoal(Vector3.fromXY((field.xExtent() / 2) + 1, 0)));\n\t\tassertTrue(NGeometry.ballInsideGoal(Vector3.fromXY(-(field.xE... | {
"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 boolean ballInsideGoal(final IVector3 pos)\n\t{\n\t\treturn ballInsideGoal(pos, 0, 0);\n\t}",
"class_method_signature": "NGeometry.ballInsideGoal(final IVector3 pos)",
"constructor": false,
"full_signature": "public static boolean ballInsideGoal(final IVector3 pos)",
"identifier": "ba... | {
"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_160 | {
"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 testIsValid()\n\t{\n\t\tIVector2 sV = Vector2.fromXY(1, 2);\n\t\tIVector2 dV = Vector2.fromAngle(1.5d);\n\t\t\n\t\tIHalfLine validLine = HalfLine.fromDirection(sV, dV);\n\t\tassertThat(validLine.isValid(), is(true));\n\t\t\n\t\tIHalfLine invalidLine = HalfLine.fromDirection(sV, Vector2... | {
"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_45 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/rectangle/RectangleTest.java",
"identifier": "RectangleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testLineIntersections()\n\t{\n\t\tRectangle rect = Rectangle.fromCenter(Vector2.zero(), 42, 42);\n\t\t\n\t\tassertThat(rect.lineIntersections(\n\t\t\t\tLine.fromDirection(Vector2.zero(), Vector2.fromX(1)))).containsExactlyInAnyOrder(\n\t\t\t\t\t\tVector2.fromX(21), Vector2.fromX(-21));... | {
"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_12 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/circle/CircleMathTest.java",
"identifier": "CircleMathTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void isPointInCircle()\n\t{\n\t\tdouble radius = 300;\n\t\tdouble margin = 0.0;\n\t\tICircle circle = Circle.createCircle(Vector2.fromXY(1000, 500), radius);\n\t\tassertThat(CircleMath.isPointInCircle(circle, Vector2.fromXY(1000, 500), margin)).isTrue();\n\t\tassertThat(CircleMath.isPointIn... | {
"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 isPointInCircle(ICircular circle, IVector2 point, double margin)\n\t{\n\t\treturn point.distanceToSqr(circle.center()) <= Math.pow(circle.radius() + margin, 2);\n\t}",
"class_method_signature": "CircleMath.isPointInCircle(ICircular circle, IVector2 point, double margin)",
"constru... | {
"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_137 | {
"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\tVector3 vector = Vector3.fromXYZ(42, 1337, 3.14);\n\t\tassertThat(vector.getXYZVector()).isSameAs(vector);\n\t}",
"class_method_signature": "Vector3Test.testGetXYZVector()",
"constructor": false,
"full_signature": "@Test public void testGetXYZVector()... | {
"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": "@Override\n\tpublic Vector3 getXYZVector()\n\t{\n\t\treturn this;\n\t}",
"class_method_signature": "Vector3.getXYZVector()",
"constructor": false,
"full_signature": "@Override public Vector3 getXYZVector()",
"identifier": "getXYZVector",
"invocations": [],
"modifiers": "@Override public",
"pa... | {
"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_208 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/line/LineTest.java",
"identifier": "LineTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetYIntercept()\n\t{\n\t\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.getYIntercept().isPresent(), is(true));\n\t\tassertThat(line1.getYIntercept().get(), IsCloseTo.clos... | {
"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_121 | {
"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 testSubtractNew()\n\t{\n\t\tVector3 vec1 = Vector3.fromXYZ(5, 7, 2);\n\t\tVector3 vec2 = Vector3.fromXYZ(1, 2, -1);\n\t\tVector3 result = vec1.subtractNew(vec2);\n\t\tassertEquals(Vector3.fromXYZ(4, 5, 3), result);\n\t\t\n\t\tvec1 = Vector3.fromXYZ(-3, 0, 1);\n\t\tvec2 = 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 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_53 | {
"fields": [
{
"declarator": "ACCURACY\t= 0.001",
"modifier": "private static final",
"original_string": "private static final double\tACCURACY\t= 0.001;",
"type": "double",
"var_name": "ACCURACY"
}
],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/AngleM... | {
"body": "@Test\n\tpublic void testNormalizeAngle()\n\t{\n\t\tassertEquals(AngleMath.normalizeAngle(4.6f * AngleMath.PI), 0.6 * AngleMath.PI, ACCURACY);\n\t\tassertEquals(AngleMath.normalizeAngle(-4.6f * AngleMath.PI), -0.6f * AngleMath.PI, ACCURACY);\n\t\tassertEquals(AngleMath.normalizeAngle(3.6f * AngleMath.PI), ... | {
"fields": [
{
"declarator": "PI = Math.PI",
"modifier": "public static final",
"original_string": "public static final double PI = Math.PI;",
"type": "double",
"var_name": "PI"
},
{
"declarator": "PI_TWO = Math.PI * 2.0",
"modifier": "public static final",
... | {
"body": "public static double normalizeAngle(final double angle)\n\t{\n\t\t// Don't call this a hack! It's numeric!\n\t\treturn angle - (Math.round((angle / (PI_TWO)) - 1e-6) * PI_TWO);\n\t}",
"class_method_signature": "AngleMath.normalizeAngle(final double angle)",
"constructor": false,
"full_signature": "pu... | {
"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_176 | {
"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 testFromPoints()\n\t{\n\t\tIVector2 start = Vector2.fromXY(1, 2);\n\t\tIVector2 end = Vector2.fromXY(21, 42);\n\t\tIVector2 dV = end.subtractNew(start);\n\t\t\n\t\tILineSegment segment = LineSegment.fromPoints(start, end);\n\t\t\n\t\tassertThat(segment.getStart(), is(start));\n\t\t\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": "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_199 | {
"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 testClosestPointOnLine()\n\t{\n\t\tIVector2 sV = Vector2.fromXY(0, 1);\n\t\tIVector2 dV = Vector2.fromXY(1, 1);\n\t\tILine line = Line.fromDirection(sV, dV);\n\t\tILine invalidLine = Line.fromDirection(sV, Vector2f.ZERO_VECTOR);\n\t\t\n\t\t\n\t\tIVector2 curPoint = Vector2.fromXY(0, 0)... | {
"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 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.closestPointOnLine(this, point);\n\t}",
"class_method_signature": "Line.closestPointOnLine(final IVector2 point)",
"constructor": false,
"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_101 | {
"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 testIsZeroVector()\n\t{\n\t\tassertThat(Vector2.fromXY(0, 0).isZeroVector()).isTrue();\n\t\tassertThat(Vector2.fromXY(1e-8, 0).isZeroVector()).isTrue();\n\t\tassertThat(Vector2.fromXY(1e-8, 1e-8).isZeroVector()).isTrue();\n\t\tassertThat(Vector2.fromXY(1e-2, 0).isZeroVector()).isFalse(... | {
"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_24 | {
"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 LineIntersections()\n\t{\n\t\t// Test 1\n\t\tICircle circle = Circle.createCircle(Vector2.fromXY(1, 1), 1);\n\t\tLine line = Line.fromDirection(Vector2f.ZERO_VECTOR, Vector2.fromXY(-1, 1));\n\t\tif (circle.lineIntersections(line).size() == 0)\n\t\t{\n\t\t\tAssert.assertTrue(true);\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 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_228 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/triangle/TriangleTest.java",
"identifier": "TriangleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testLineIntersections()\n\t{\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\tTriangle triangle = Triangle.fromCorners(a, b, c);\n\t\t\n\t\t// Intersecting lines\n\t\tILine line1 = edu.tigers.sum... | {
"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": "@Override\n\tpublic List<IVector2> lineIntersections(final ILine line)\n\t{\n\t\tILineSegment ab = Lines.segmentFromPoints(a, b);\n\t\tILineSegment bc = Lines.segmentFromPoints(b, c);\n\t\tILineSegment ac = Lines.segmentFromPoints(a, c);\n\t\tILineSegment[] lines = new ILineSegment[] { ab, ac, bc };\n\t\tL... | {
"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_73 | {
"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 testIsZeroVector()\n\t{\n\t\tassertThat(VectorN.from(0, 0, 0).isZeroVector()).isTrue();\n\t\tassertThat(VectorN.from(1e-8, 0, 0).isZeroVector()).isTrue();\n\t\tassertThat(VectorN.from(1e-8, 1e-8, 1e-8).isZeroVector()).isTrue();\n\t\tassertThat(VectorN.from(1e-2, 0, 0).isZeroVector()).i... | {
"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_156 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/SumatraMathTest.java",
"identifier": "SumatraMathTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testIsZero()\n\t{\n\t\tAssertions.assertThat(SumatraMath.isZero(0.0)).isTrue();\n\t\tAssertions.assertThat(SumatraMath.isZero(1e-10)).isTrue();\n\t\tAssertions.assertThat(SumatraMath.isZero(1)).isFalse();\n\t\tAssertions.assertThat(SumatraMath.isZero(-1)).isFalse();\n\t\tAssertions.ass... | {
"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 isZero(final double v)\n\t{\n\t\treturn Math.abs(v) < EQUAL_TOL;\n\t}",
"class_method_signature": "SumatraMath.isZero(final double v)",
"constructor": false,
"full_signature": "public static boolean isZero(final double v)",
"identifier": "isZero",
"invocations": [
"abs"
... | {
"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_140 | {
"fields": [],
"file": "modules/common-math/src/test/java/edu/tigers/sumatra/math/vector/Vector3fTest.java",
"identifier": "Vector3fTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testFromXYZ()\n\t{\n\t\tassertThat(Vector3f.fromXYZ(42, 1337, 3.14)).isEqualTo(Vector3.fromXYZ(42, 1337, 3.14));\n\t\tassertThat(Vector3f.fromXYZ(42, 1337, 3.14)).isNotEqualTo(Vector3.zero());\n\t}",
"class_method_signature": "Vector3fTest.testFromXYZ()",
"constructor": false,
"f... | {
"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"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.