messages
listlengths 1
1
| ground_truth
listlengths 15
15
| dataset
stringclasses 1
value | id
stringlengths 5
8
| difficulty
int64 3
3
| timestamps
listlengths 15
15
| scene_config
dict | tolerance
float64 50
50
| prompt_setting
stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 5 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (6 sides), radius 20.0m, initial position (706, 854), initial velocity (736.03, -460.43) m/s\n- Ball 2: regular polygon (4 sides), radius 20.0m, initial position (715, 630), initial velocity (160.0, -949.15) m/s\n- Ball 3: regular polygon (6 sides), radius 20.0m, initial position (955, 685), initial velocity (-393.01, 911.19) m/s\n- Ball 4: regular polygon (4 sides), radius 20.0m, initial position (769, 1016), initial velocity (188.32, -888.7) m/s\n- Ball 5: regular polygon (3 sides), radius 20.0m, initial position (887, 791), initial velocity (147.05, -792.19) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 5\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[779.61, 807.96], [730.99, 535.08], [947.27, 757.88], [787.82, 927.13], [838.54, 748.24]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[853.22, 761.91], [753.94, 461.57], [984.14, 805.03], [806.65, 838.27], [700.89, 756.98]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[927.01, 715.75], [822.83, 529.12], [1021.1, 852.29], [825.52, 749.18], [562.9, 765.75]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[1000.62, 669.71], [891.56, 596.5], [974.02, 838.43], [844.34, 660.31], [488.0, 774.49]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[990.96, 684.15], [960.29, 663.89], [917.8, 817.92], [863.16, 571.44], [625.65, 783.23]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[986.75, 802.24], [948.06, 650.32], [861.57, 797.42], [881.99, 482.57], [763.29, 791.97]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[975.48, 915.61], [933.81, 634.72], [866.28, 741.72], [829.23, 445.72], [779.08, 871.06]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[862.49, 955.12], [919.55, 619.12], [898.56, 670.12], [749.74, 469.56], [739.75, 981.97]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[766.04, 985.07], [905.29, 555.68], [930.83, 635.33], [682.26, 530.39], [702.95, 1002.38]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[770.22, 956.92], [891.03, 476.8], [963.11, 612.43], [614.78, 591.23], [535.48, 921.75]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[774.39, 928.77], [840.66, 424.15], [982.86, 598.63], [547.3, 652.07], [527.16, 785.49]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[778.57, 900.62], [804.31, 491.67], [951.12, 622.24], [479.83, 712.91], [676.55, 649.24]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[782.73, 872.54], [808.52, 496.2], [919.46, 645.79], [520.73, 773.6], [765.58, 617.22]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[786.91, 844.39], [864.61, 452.5], [887.73, 669.4], [588.21, 834.44], [749.69, 767.25]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[791.08, 816.24], [872.79, 587.15], [855.99, 693.0], [655.69, 895.28], [733.8, 917.27]]) <= 50.0"
] |
ballsim
|
G_3_47
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
208,
80,
129
],
"density": 1,
"position": [
706,
854
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
736.03,
-460.43
]
},
{
"color": [
172,
231,
90
],
"density": 1,
"position": [
715,
630
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
160,
-949.15
]
},
{
"color": [
247,
66,
247
],
"density": 1,
"position": [
955,
685
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
-393.01,
911.19
]
},
{
"color": [
63,
193,
224
],
"density": 1,
"position": [
769,
1016
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
188.32,
-888.7
]
},
{
"color": [
65,
170,
96
],
"density": 1,
"position": [
887,
791
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
147.05,
-792.19
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 5
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 47,
"multi_object_count": 5,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 4366641
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 6 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (5 sides), radius 20.0m, initial position (840, 840), initial velocity (3.38, 811.52) m/s\n- Ball 2: regular polygon (6 sides), radius 20.0m, initial position (483, 796), initial velocity (777.67, -383.74) m/s\n- Ball 3: regular polygon (6 sides), radius 20.0m, initial position (624, 851), initial velocity (878.64, -56.78) m/s\n- Ball 4: regular polygon (5 sides), radius 20.0m, initial position (871, 804), initial velocity (325.82, -897.19) m/s\n- Ball 5: regular polygon (4 sides), radius 20.0m, initial position (691, 619), initial velocity (266.17, 766.34) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 5\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[840.34, 921.15], [560.76, 757.62], [711.87, 845.31], [903.59, 714.28], [717.61, 695.64]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[840.68, 1002.3], [638.52, 719.24], [799.73, 839.62], [936.19, 624.56], [744.22, 772.27]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[841.03, 1027.8], [716.48, 680.77], [887.82, 833.92], [968.86, 534.61], [770.9, 849.1]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[841.37, 946.64], [794.23, 642.39], [975.68, 828.23], [892.53, 507.77], [797.51, 925.73]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[841.71, 865.49], [871.99, 604.01], [1062.89, 822.17], [798.53, 491.13], [824.12, 1002.37]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[842.05, 784.34], [949.75, 565.63], [1023.87, 743.24], [704.54, 474.49], [850.73, 1030.51]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[842.39, 703.19], [950.82, 571.54], [984.86, 664.31], [610.54, 457.85], [877.35, 953.88]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[840.62, 623.26], [880.64, 618.59], [945.85, 585.38], [606.1, 492.92], [903.96, 877.24]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[725.73, 608.63], [913.96, 605.87], [906.83, 506.44], [667.51, 565.99], [930.57, 800.61]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[738.83, 687.0], [947.29, 593.15], [867.82, 457.63], [600.93, 546.07], [957.18, 723.97]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[781.04, 786.51], [980.61, 580.43], [828.81, 536.56], [556.51, 534.6], [983.79, 647.33]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[823.25, 886.02], [966.78, 565.07], [789.79, 615.49], [639.91, 596.93], [1010.4, 609.51]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[865.36, 985.28], [891.13, 559.78], [750.88, 694.22], [723.1, 659.1], [1013.55, 618.64]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[907.57, 1026.66], [815.3, 554.48], [711.86, 773.15], [806.5, 721.43], [996.43, 639.49]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[949.78, 927.15], [739.47, 549.19], [672.85, 852.08], [889.9, 783.76], [979.32, 660.34]]) <= 50.0"
] |
ballsim
|
G_3_1018
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
213,
218,
60
],
"density": 1,
"position": [
840,
840
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
3.38,
811.52
]
},
{
"color": [
217,
231,
208
],
"density": 1,
"position": [
483,
796
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
777.67,
-383.74
]
},
{
"color": [
251,
119,
226
],
"density": 1,
"position": [
624,
851
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
878.64,
-56.78
]
},
{
"color": [
223,
140,
200
],
"density": 1,
"position": [
871,
804
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
325.82,
-897.19
]
},
{
"color": [
74,
247,
226
],
"density": 1,
"position": [
691,
619
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
266.17,
766.34
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 6
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 1018,
"multi_object_count": 5,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 1648766
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 6 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (3 sides), radius 20.0m, initial position (741, 618), initial velocity (-954.48, -228.51) m/s\n- Ball 2: regular polygon (4 sides), radius 20.0m, initial position (944, 556), initial velocity (-869.99, -206.29) m/s\n- Ball 3: regular polygon (5 sides), radius 20.0m, initial position (837, 622), initial velocity (776.64, -319.66) m/s\n- Ball 4: regular polygon (6 sides), radius 20.0m, initial position (816, 742), initial velocity (512.93, 669.68) m/s\n- Ball 5: regular polygon (5 sides), radius 20.0m, initial position (695, 941), initial velocity (868.93, -186.54) m/s\n- Ball 6: regular polygon (3 sides), radius 20.0m, initial position (708, 1020), initial velocity (215.64, -937.27) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 6\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[645.54, 595.15], [857.01, 535.37], [914.66, 590.04], [867.29, 808.97], [781.89, 922.35], [729.56, 926.27]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[550.08, 572.3], [770.03, 514.74], [992.32, 558.08], [918.59, 875.94], [868.78, 903.7], [751.12, 832.55]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[539.05, 598.27], [682.82, 494.06], [928.45, 607.87], [1005.27, 914.26], [909.35, 911.87], [772.73, 738.59]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[606.56, 669.51], [595.83, 473.43], [861.94, 659.14], [921.63, 832.94], [929.63, 931.67], [794.28, 644.86]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[674.06, 740.75], [595.47, 502.82], [795.44, 710.41], [837.99, 751.61], [949.92, 951.47], [815.84, 551.14]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[741.57, 811.99], [656.83, 567.86], [676.17, 731.22], [802.62, 698.17], [970.21, 971.27], [837.4, 457.41]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[809.07, 883.23], [718.18, 632.9], [536.28, 740.13], [786.11, 655.61], [953.46, 969.69], [858.96, 521.45]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[876.58, 954.47], [779.53, 697.94], [399.6, 750.9], [769.61, 613.06], [926.17, 962.02], [880.51, 615.18]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[838.8, 1025.71], [840.88, 762.98], [475.61, 868.56], [753.11, 570.5], [956.4, 954.36], [902.07, 708.91]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[783.7, 1017.9], [902.02, 828.23], [553.27, 985.26], [736.6, 527.95], [989.08, 942.64], [923.97, 802.29]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[728.6, 946.66], [936.42, 920.23], [630.93, 1009.5], [720.1, 485.4], [975.87, 904.43], [987.05, 854.49]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[728.59, 835.41], [944.99, 997.31], [678.49, 914.67], [703.59, 442.84], [962.67, 866.23], [996.71, 875.84]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[813.63, 662.65], [848.35, 1013.48], [679.46, 853.83], [687.13, 484.75], [907.56, 828.11], [996.92, 847.37]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[898.88, 489.45], [751.48, 1029.69], [680.44, 792.85], [670.63, 527.3], [849.45, 789.91], [1002.37, 818.83]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[984.14, 568.89], [654.6, 1045.9], [681.42, 731.86], [654.12, 569.85], [791.35, 751.7], [1007.81, 790.29]]) <= 50.0"
] |
ballsim
|
G_3_288
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
174,
218,
251
],
"density": 1,
"position": [
741,
618
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
-954.48,
-228.51
]
},
{
"color": [
170,
234,
86
],
"density": 1,
"position": [
944,
556
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
-869.99,
-206.29
]
},
{
"color": [
230,
206,
133
],
"density": 1,
"position": [
837,
622
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
776.64,
-319.66
]
},
{
"color": [
81,
109,
76
],
"density": 1,
"position": [
816,
742
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
512.93,
669.68
]
},
{
"color": [
232,
212,
120
],
"density": 1,
"position": [
695,
941
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
868.93,
-186.54
]
},
{
"color": [
123,
89,
177
],
"density": 1,
"position": [
708,
1020
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
215.64,
-937.27
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 6
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 288,
"multi_object_count": 6,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 4399566
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 5 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (4 sides), radius 20.0m, initial position (731, 682), initial velocity (617.62, 602.99) m/s\n- Ball 2: regular polygon (4 sides), radius 20.0m, initial position (727, 738), initial velocity (-258.54, 878.51) m/s\n- Ball 3: regular polygon (5 sides), radius 20.0m, initial position (740, 494), initial velocity (-28.22, 865.51) m/s\n- Ball 4: regular polygon (6 sides), radius 20.0m, initial position (854, 970), initial velocity (-899.16, 252.69) m/s\n- Ball 5: regular polygon (4 sides), radius 20.0m, initial position (787, 817), initial velocity (708.96, -455.48) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 5\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[792.77, 742.3], [701.15, 825.84], [737.17, 580.55], [764.08, 995.27], [857.9, 771.44]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[854.54, 802.61], [675.29, 913.68], [734.34, 667.1], [674.17, 1020.54], [928.8, 725.89]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[916.46, 863.06], [683.85, 967.26], [731.5, 753.86], [587.69, 979.46], [999.87, 680.22]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[978.22, 923.36], [730.95, 982.16], [728.66, 840.41], [475.82, 955.63], [1005.87, 681.81]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[902.84, 884.02], [778.04, 997.05], [725.83, 926.96], [559.78, 902.46], [940.63, 735.16]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[826.4, 843.91], [825.14, 1011.94], [723.0, 1013.5], [662.12, 849.28], [875.4, 788.5]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[788.06, 823.94], [872.23, 1026.84], [754.13, 995.54], [731.79, 777.24], [814.52, 846.21]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[794.62, 805.51], [884.9, 1016.72], [768.76, 957.82], [722.41, 659.57], [851.8, 921.31]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[801.19, 787.08], [856.17, 976.54], [708.24, 995.27], [713.04, 541.89], [978.44, 907.05]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[807.76, 768.65], [827.43, 936.35], [655.94, 1007.41], [728.6, 500.97], [969.15, 794.06]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[814.32, 750.21], [798.7, 896.17], [628.98, 941.54], [790.17, 601.67], [943.56, 669.23]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[820.89, 731.78], [769.96, 855.98], [602.03, 875.67], [851.74, 702.38], [917.98, 544.4]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[827.44, 713.39], [741.3, 815.9], [575.15, 809.97], [913.16, 802.84], [856.7, 445.86]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[834.01, 694.96], [712.56, 775.71], [548.19, 744.1], [974.73, 903.55], [786.67, 508.5]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[840.58, 676.53], [683.83, 735.53], [521.24, 678.23], [881.01, 891.43], [733.99, 624.52]]) <= 50.0"
] |
ballsim
|
G_3_617
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
95,
115,
132
],
"density": 1,
"position": [
731,
682
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
617.62,
602.99
]
},
{
"color": [
118,
115,
227
],
"density": 1,
"position": [
727,
738
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
-258.54,
878.51
]
},
{
"color": [
67,
159,
172
],
"density": 1,
"position": [
740,
494
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
-28.22,
865.51
]
},
{
"color": [
190,
102,
147
],
"density": 1,
"position": [
854,
970
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
-899.16,
252.69
]
},
{
"color": [
138,
73,
67
],
"density": 1,
"position": [
787,
817
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
708.96,
-455.48
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 5
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 617,
"multi_object_count": 5,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 4495167
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 6 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (4 sides), radius 20.0m, initial position (660, 610), initial velocity (-25.18, -890.83) m/s\n- Ball 2: regular polygon (5 sides), radius 20.0m, initial position (692, 733), initial velocity (-164.21, 958.8) m/s\n- Ball 3: regular polygon (4 sides), radius 20.0m, initial position (967, 867), initial velocity (-642.09, 560.99) m/s\n- Ball 4: regular polygon (3 sides), radius 20.0m, initial position (619, 854), initial velocity (876.43, -240.94) m/s\n- Ball 5: regular polygon (6 sides), radius 20.0m, initial position (690, 862), initial velocity (727.08, -384.51) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 5\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[657.49, 520.91], [683.92, 803.2], [902.79, 923.1], [691.38, 876.89], [762.71, 823.55]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[654.97, 458.67], [699.44, 800.79], [838.58, 979.21], [720.58, 1032.7], [835.41, 785.1]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[652.45, 547.98], [715.01, 798.36], [774.21, 1035.45], [749.85, 925.96], [908.3, 746.55]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[649.94, 637.07], [730.54, 795.95], [710.0, 1017.94], [779.05, 770.15], [981.0, 708.1]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[647.42, 726.16], [746.06, 793.53], [645.79, 961.84], [808.25, 614.34], [1053.71, 669.64]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[644.91, 815.24], [761.59, 791.11], [581.59, 905.74], [837.45, 458.53], [991.37, 709.16]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[642.39, 904.33], [777.12, 788.7], [517.38, 849.63], [866.65, 582.42], [921.72, 752.91]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[639.88, 993.42], [792.65, 786.28], [453.17, 793.53], [895.85, 738.23], [852.07, 796.66]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[637.36, 1027.01], [789.53, 770.32], [408.93, 748.96], [925.05, 894.05], [799.47, 852.8]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[634.85, 937.92], [769.75, 742.27], [489.61, 776.52], [920.68, 1030.48], [762.12, 920.01]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[632.33, 848.84], [749.98, 714.22], [570.3, 804.08], [771.14, 1031.75], [724.76, 987.22]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[696.36, 826.29], [730.2, 686.17], [584.45, 765.11], [770.91, 1049.53], [612.77, 1011.33]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[793.53, 837.11], [710.48, 658.19], [565.26, 692.92], [802.67, 997.57], [589.13, 966.05]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[890.94, 847.95], [690.7, 630.14], [546.02, 620.56], [834.5, 945.5], [666.01, 862.58]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[988.35, 858.78], [670.93, 602.08], [526.78, 548.2], [866.34, 893.42], [742.89, 759.11]]) <= 50.0"
] |
ballsim
|
G_3_975
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
66,
248,
252
],
"density": 1,
"position": [
660,
610
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
-25.18,
-890.83
]
},
{
"color": [
214,
177,
88
],
"density": 1,
"position": [
692,
733
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
-164.21,
958.8
]
},
{
"color": [
87,
103,
132
],
"density": 1,
"position": [
967,
867
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
-642.09,
560.99
]
},
{
"color": [
240,
224,
151
],
"density": 1,
"position": [
619,
854
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
876.43,
-240.94
]
},
{
"color": [
163,
217,
127
],
"density": 1,
"position": [
690,
862
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
727.08,
-384.51
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 6
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 975,
"multi_object_count": 5,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 5203587
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 6 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (4 sides), radius 20.0m, initial position (685, 561), initial velocity (786.33, 487.27) m/s\n- Ball 2: regular polygon (4 sides), radius 20.0m, initial position (566, 831), initial velocity (-688.12, -615.5) m/s\n- Ball 3: regular polygon (3 sides), radius 20.0m, initial position (791, 665), initial velocity (-343.41, 785.7) m/s\n- Ball 4: regular polygon (6 sides), radius 20.0m, initial position (733, 760), initial velocity (-705.8, 651.16) m/s\n- Ball 5: regular polygon (5 sides), radius 20.0m, initial position (798, 939), initial velocity (937.71, -252.19) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 5\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[763.64, 609.73], [497.18, 769.45], [756.65, 743.56], [662.42, 825.11], [891.77, 913.78]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[842.28, 658.46], [428.37, 707.9], [722.3, 822.13], [591.84, 890.22], [985.55, 888.56]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[921.11, 707.31], [502.72, 728.95], [687.86, 900.89], [521.08, 955.5], [1019.6, 828.66]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[959.37, 715.66], [590.43, 757.75], [653.51, 979.45], [601.62, 933.36], [1028.52, 768.81]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[904.26, 630.65], [678.15, 786.56], [619.16, 1056.84], [693.29, 904.8], [1067.03, 759.24]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[849.16, 545.64], [765.87, 815.37], [584.81, 978.28], [784.97, 876.23], [1007.13, 692.85]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[794.06, 460.63], [841.84, 832.43], [550.46, 899.71], [885.69, 856.72], [947.24, 626.47]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[738.96, 514.88], [899.36, 831.07], [516.11, 821.15], [1000.61, 851.4], [887.35, 560.09]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[683.85, 599.89], [956.88, 829.7], [481.77, 742.58], [1016.53, 788.91], [827.46, 493.7]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[628.75, 684.9], [1014.4, 828.33], [447.43, 664.02], [963.7, 686.71], [767.58, 461.23]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[573.65, 769.91], [1054.87, 817.12], [528.48, 652.07], [910.87, 584.51], [707.69, 527.62]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[518.55, 854.91], [1027.28, 766.61], [613.68, 642.52], [858.03, 482.32], [647.8, 594.01]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[525.02, 904.24], [999.76, 716.22], [662.85, 743.28], [805.33, 504.75], [607.64, 599.98]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[626.19, 899.01], [972.17, 665.71], [701.28, 877.73], [752.5, 606.95], [573.31, 587.69]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[727.36, 893.79], [944.59, 615.2], [739.71, 1012.18], [699.67, 709.15], [538.99, 575.41]]) <= 50.0"
] |
ballsim
|
G_3_583
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
125,
71,
135
],
"density": 1,
"position": [
685,
561
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
786.33,
487.27
]
},
{
"color": [
53,
98,
208
],
"density": 1,
"position": [
566,
831
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
-688.12,
-615.5
]
},
{
"color": [
135,
176,
122
],
"density": 1,
"position": [
791,
665
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
-343.41,
785.7
]
},
{
"color": [
121,
139,
78
],
"density": 1,
"position": [
733,
760
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
-705.8,
651.16
]
},
{
"color": [
152,
118,
72
],
"density": 1,
"position": [
798,
939
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
937.71,
-252.19
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 6
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 583,
"multi_object_count": 5,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 1146209
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 5 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (4 sides), radius 20.0m, initial position (897, 703), initial velocity (18.47, 829.7) m/s\n- Ball 2: regular polygon (3 sides), radius 20.0m, initial position (790, 987), initial velocity (-858.91, 352.24) m/s\n- Ball 3: regular polygon (5 sides), radius 20.0m, initial position (797, 728), initial velocity (-495.38, -639.92) m/s\n- Ball 4: regular polygon (3 sides), radius 20.0m, initial position (929, 929), initial velocity (-795.96, 449.63) m/s\n- Ball 5: regular polygon (5 sides), radius 20.0m, initial position (607, 811), initial velocity (-463.9, -817.71) m/s\n- Ball 6: regular polygon (6 sides), radius 20.0m, initial position (955, 881), initial velocity (-753.07, -378.07) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 6\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[898.86, 785.96], [704.11, 1022.23], [747.46, 664.01], [849.41, 973.97], [560.61, 729.24], [879.68, 843.18]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[900.71, 868.92], [648.7, 963.65], [697.93, 600.02], [769.82, 1018.94], [514.23, 647.47], [804.37, 805.37]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[902.57, 952.08], [599.8, 884.47], [648.27, 535.87], [710.66, 1000.54], [467.72, 565.51], [728.86, 767.45]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[895.87, 1028.83], [551.02, 805.49], [613.6, 517.64], [672.69, 917.39], [530.22, 563.57], [653.54, 729.64]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[816.41, 1052.71], [502.24, 726.51], [641.61, 576.39], [634.73, 834.23], [585.34, 624.6], [578.22, 691.82]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[755.65, 1018.98], [459.81, 647.53], [716.76, 600.9], [596.39, 752.24], [593.53, 719.23], [502.91, 654.0]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[705.38, 952.94], [509.23, 548.65], [791.9, 625.42], [496.27, 860.35], [635.48, 710.0], [474.35, 643.19]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[655.11, 886.9], [631.4, 629.12], [867.05, 649.93], [517.1, 968.45], [677.42, 700.77], [484.05, 634.35]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[604.84, 820.86], [714.11, 641.25], [942.2, 674.44], [659.11, 947.6], [740.92, 728.87], [509.2, 625.52]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[554.57, 754.82], [760.11, 589.79], [1017.34, 698.95], [803.65, 918.98], [824.49, 791.71], [534.35, 616.68]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[504.3, 688.78], [806.1, 538.32], [1083.61, 729.91], [948.18, 890.37], [908.06, 854.55], [559.49, 607.84]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[479.22, 622.74], [852.1, 486.86], [1055.51, 788.45], [1002.49, 796.21], [980.81, 909.54], [584.64, 599.0]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[529.36, 556.87], [869.87, 455.94], [980.5, 812.73], [985.08, 650.26], [895.43, 849.63], [609.72, 590.19]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[588.76, 518.95], [806.71, 483.77], [905.3, 837.07], [913.42, 543.32], [809.84, 789.57], [634.87, 581.35]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[668.23, 534.18], [743.56, 511.6], [830.11, 861.42], [779.65, 481.51], [724.24, 729.51], [660.02, 579.16]]) <= 50.0"
] |
ballsim
|
G_3_803
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
156,
109,
105
],
"density": 1,
"position": [
897,
703
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
18.47,
829.7
]
},
{
"color": [
69,
113,
97
],
"density": 1,
"position": [
790,
987
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
-858.91,
352.24
]
},
{
"color": [
123,
226,
151
],
"density": 1,
"position": [
797,
728
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
-495.38,
-639.92
]
},
{
"color": [
59,
143,
90
],
"density": 1,
"position": [
929,
929
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
-795.96,
449.63
]
},
{
"color": [
160,
90,
184
],
"density": 1,
"position": [
607,
811
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
-463.9,
-817.71
]
},
{
"color": [
61,
234,
254
],
"density": 1,
"position": [
955,
881
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
-753.07,
-378.07
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 5
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 803,
"multi_object_count": 6,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 3732039
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 6 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (4 sides), radius 20.0m, initial position (799, 482), initial velocity (-495.78, 861.07) m/s\n- Ball 2: regular polygon (3 sides), radius 20.0m, initial position (728, 747), initial velocity (-428.87, -729.35) m/s\n- Ball 3: regular polygon (6 sides), radius 20.0m, initial position (862, 598), initial velocity (-254.63, 964.54) m/s\n- Ball 4: regular polygon (6 sides), radius 20.0m, initial position (915, 640), initial velocity (839.46, -114.4) m/s\n- Ball 5: regular polygon (3 sides), radius 20.0m, initial position (573, 642), initial velocity (936.94, 15.87) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 5\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[749.42, 568.11], [685.1, 674.08], [836.54, 694.46], [998.94, 628.55], [666.7, 643.59]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[699.83, 654.22], [705.84, 711.32], [811.07, 790.92], [1000.95, 664.4], [696.77, 534.98]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[650.12, 740.54], [729.44, 753.51], [785.54, 887.62], [948.94, 731.53], [724.11, 463.89]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[600.54, 826.65], [752.97, 795.6], [760.08, 984.08], [897.06, 798.5], [751.38, 577.33]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[550.95, 912.76], [776.51, 837.69], [734.62, 1034.33], [845.18, 865.47], [778.65, 690.79]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[557.36, 966.54], [800.04, 879.78], [709.15, 937.87], [793.3, 932.44], [805.92, 804.24]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[656.72, 966.66], [812.79, 940.56], [683.69, 841.41], [741.42, 999.4], [843.97, 899.0]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[756.09, 966.79], [806.37, 1034.55], [658.23, 744.95], [689.54, 1048.47], [901.2, 960.55]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[855.45, 966.91], [799.95, 986.31], [632.76, 648.49], [637.66, 981.49], [942.62, 1012.97]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[954.82, 967.03], [793.53, 892.32], [607.3, 552.03], [585.78, 914.53], [860.69, 994.17]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[942.33, 902.57], [787.11, 798.32], [581.83, 455.57], [533.9, 847.56], [778.75, 975.38]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[892.55, 816.59], [780.69, 704.33], [556.37, 526.03], [482.02, 780.59], [696.82, 956.58]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[842.89, 730.81], [774.28, 610.57], [530.97, 622.25], [430.27, 713.79], [615.09, 937.83]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[793.11, 644.83], [767.86, 516.57], [528.45, 705.46], [469.74, 726.06], [533.16, 919.03]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[743.33, 558.84], [761.44, 462.55], [621.86, 733.29], [434.81, 806.13], [497.01, 873.8]]) <= 50.0"
] |
ballsim
|
G_3_537
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
185,
192,
117
],
"density": 1,
"position": [
799,
482
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
-495.78,
861.07
]
},
{
"color": [
109,
161,
134
],
"density": 1,
"position": [
728,
747
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
-428.87,
-729.35
]
},
{
"color": [
75,
172,
114
],
"density": 1,
"position": [
862,
598
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
-254.63,
964.54
]
},
{
"color": [
116,
182,
112
],
"density": 1,
"position": [
915,
640
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
839.46,
-114.4
]
},
{
"color": [
245,
158,
124
],
"density": 1,
"position": [
573,
642
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
936.94,
15.87
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 6
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 537,
"multi_object_count": 5,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 9273495
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 6 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (3 sides), radius 20.0m, initial position (662, 711), initial velocity (-848.6, 370.0) m/s\n- Ball 2: regular polygon (6 sides), radius 20.0m, initial position (496, 874), initial velocity (869.61, -240.7) m/s\n- Ball 3: regular polygon (4 sides), radius 20.0m, initial position (672, 511), initial velocity (825.38, -322.28) m/s\n- Ball 4: regular polygon (4 sides), radius 20.0m, initial position (715, 748), initial velocity (-589.51, -767.61) m/s\n- Ball 5: regular polygon (5 sides), radius 20.0m, initial position (670, 664), initial velocity (-94.33, 869.36) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 5\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[577.14, 748.01], [582.96, 849.93], [754.54, 478.77], [726.35, 741.54], [601.44, 691.8]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[492.27, 785.02], [669.93, 825.86], [837.09, 446.55], [783.21, 780.58], [494.6, 681.33]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[451.38, 796.62], [757.11, 801.72], [919.84, 476.28], [840.21, 819.71], [471.79, 719.49]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[473.81, 831.79], [844.07, 777.65], [947.15, 540.39], [897.07, 858.75], [562.72, 757.53]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[508.71, 896.14], [931.03, 753.58], [933.8, 627.99], [953.94, 897.79], [670.87, 765.76]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[590.96, 933.16], [1017.99, 729.51], [920.45, 715.59], [990.29, 924.99], [779.03, 773.98]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[673.21, 970.17], [1066.41, 727.69], [910.55, 805.7], [928.06, 895.28], [884.27, 780.1]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[755.46, 1007.18], [1002.1, 790.97], [954.55, 914.28], [853.84, 877.54], [954.24, 760.59]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[837.71, 1044.19], [937.77, 854.25], [927.76, 956.71], [763.59, 875.83], [1024.21, 741.08]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[919.96, 1033.64], [873.44, 917.54], [817.58, 951.0], [673.33, 874.12], [1085.78, 726.43]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[942.78, 962.32], [809.11, 980.82], [707.4, 945.28], [583.07, 872.41], [1033.87, 777.26]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[933.7, 872.57], [744.77, 1044.1], [597.22, 939.57], [492.81, 870.7], [981.99, 828.09]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[885.05, 783.05], [680.6, 1007.64], [508.1, 921.87], [494.18, 816.24], [951.86, 878.79]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[820.6, 693.3], [616.27, 944.36], [558.24, 823.6], [537.83, 737.24], [930.23, 929.62]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[756.14, 603.56], [551.94, 881.07], [608.39, 725.34], [581.48, 658.23], [908.6, 980.45]]) <= 50.0"
] |
ballsim
|
G_3_700
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
94,
198,
93
],
"density": 1,
"position": [
662,
711
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
-848.6,
370
]
},
{
"color": [
195,
96,
236
],
"density": 1,
"position": [
496,
874
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
869.61,
-240.7
]
},
{
"color": [
196,
119,
126
],
"density": 1,
"position": [
672,
511
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
825.38,
-322.28
]
},
{
"color": [
154,
97,
177
],
"density": 1,
"position": [
715,
748
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
-589.51,
-767.61
]
},
{
"color": [
231,
236,
217
],
"density": 1,
"position": [
670,
664
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
-94.33,
869.36
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 6
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 700,
"multi_object_count": 5,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 1645567
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 6 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (6 sides), radius 20.0m, initial position (854, 835), initial velocity (-220.23, -819.87) m/s\n- Ball 2: regular polygon (3 sides), radius 20.0m, initial position (989, 854), initial velocity (898.46, -399.29) m/s\n- Ball 3: regular polygon (5 sides), radius 20.0m, initial position (601, 531), initial velocity (488.34, -841.93) m/s\n- Ball 4: regular polygon (6 sides), radius 20.0m, initial position (811, 898), initial velocity (630.46, -652.75) m/s\n- Ball 5: regular polygon (4 sides), radius 20.0m, initial position (755, 530), initial velocity (822.58, 70.65) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 5\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[831.98, 753.02], [1062.56, 804.68], [649.83, 446.81], [874.04, 832.72], [837.25, 537.06]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[809.96, 671.04], [1052.21, 706.9], [698.66, 525.95], [937.07, 767.43], [919.5, 544.11]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[787.88, 588.85], [1014.35, 624.76], [747.61, 610.36], [1000.27, 701.99], [984.33, 561.37]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[765.86, 506.87], [994.0, 634.65], [796.43, 694.57], [1037.86, 663.11], [897.73, 584.55]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[743.84, 460.26], [890.04, 608.06], [845.26, 778.77], [1015.73, 723.12], [792.99, 589.58]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[721.82, 542.24], [786.09, 581.47], [894.09, 862.97], [993.59, 783.13], [688.26, 594.6]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[668.01, 624.22], [745.7, 554.89], [942.92, 947.18], [971.44, 843.14], [583.52, 599.63]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[591.35, 706.21], [751.0, 528.3], [917.92, 988.76], [949.3, 903.15], [478.99, 604.78]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[514.69, 788.19], [756.29, 501.71], [820.59, 988.56], [927.15, 963.16], [527.01, 698.02]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[477.57, 847.35], [761.59, 475.12], [723.25, 988.37], [905.01, 1023.17], [575.03, 791.26]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[586.9, 821.96], [766.89, 448.54], [625.91, 988.17], [882.87, 1031.68], [623.05, 884.5]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[696.22, 796.56], [772.19, 463.19], [538.78, 982.08], [860.72, 971.67], [671.07, 977.73]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[805.28, 771.24], [777.47, 489.71], [587.14, 897.89], [838.64, 911.81], [718.98, 1038.77]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[914.6, 745.85], [782.77, 516.3], [635.63, 813.49], [816.49, 851.8], [767.0, 945.54]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[1023.93, 720.46], [788.07, 542.88], [684.11, 729.09], [794.35, 791.79], [815.02, 852.3]]) <= 50.0"
] |
ballsim
|
G_3_957
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
174,
96,
85
],
"density": 1,
"position": [
854,
835
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
-220.23,
-819.87
]
},
{
"color": [
132,
116,
152
],
"density": 1,
"position": [
989,
854
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
898.46,
-399.29
]
},
{
"color": [
110,
233,
147
],
"density": 1,
"position": [
601,
531
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
488.34,
-841.93
]
},
{
"color": [
227,
129,
238
],
"density": 1,
"position": [
811,
898
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
630.46,
-652.75
]
},
{
"color": [
133,
234,
153
],
"density": 1,
"position": [
755,
530
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
822.58,
70.65
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 6
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 957,
"multi_object_count": 5,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 2341497
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 4 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (6 sides), radius 20.0m, initial position (813, 834), initial velocity (-160.71, 922.24) m/s\n- Ball 2: regular polygon (5 sides), radius 20.0m, initial position (593, 707), initial velocity (699.01, -594.33) m/s\n- Ball 3: regular polygon (4 sides), radius 20.0m, initial position (758, 701), initial velocity (-973.31, 134.11) m/s\n- Ball 4: regular polygon (5 sides), radius 20.0m, initial position (647, 913), initial velocity (-820.04, 78.97) m/s\n- Ball 5: regular polygon (5 sides), radius 20.0m, initial position (810, 953), initial velocity (21.9, -910.87) m/s\n- Ball 6: regular polygon (5 sides), radius 20.0m, initial position (742, 547), initial velocity (208.79, 946.89) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 6\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[769.7, 842.42], [662.9, 647.58], [660.66, 714.4], [573.84, 912.04], [841.95, 953.48], [762.87, 641.68]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[703.81, 781.31], [732.79, 588.15], [563.32, 727.81], [581.72, 830.04], [819.84, 951.19], [783.75, 736.36]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[637.75, 720.05], [802.87, 528.58], [465.75, 741.24], [589.63, 747.82], [743.18, 894.41], [804.67, 831.27]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[611.44, 630.19], [818.94, 522.98], [421.61, 745.35], [554.29, 697.24], [666.72, 837.77], [825.55, 925.95]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[623.68, 551.13], [759.51, 592.88], [518.94, 731.95], [501.38, 659.42], [590.25, 781.13], [829.16, 1003.36]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[725.22, 561.36], [700.09, 662.77], [595.72, 655.3], [531.35, 704.48], [531.08, 777.69], [734.48, 982.49]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[826.75, 571.59], [640.67, 732.67], [661.22, 543.95], [569.16, 757.38], [481.39, 803.45], [639.8, 961.61]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[928.29, 581.82], [623.7, 771.72], [726.73, 432.6], [564.52, 841.14], [482.16, 778.75], [593.69, 892.18]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[939.71, 682.16], [636.0, 789.49], [707.77, 468.79], [546.56, 805.3], [507.91, 729.07], [645.18, 850.06]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[949.94, 783.7], [648.31, 807.26], [642.27, 580.14], [588.79, 684.93], [533.67, 679.39], [710.76, 818.18]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[960.17, 885.24], [660.61, 825.04], [699.72, 568.54], [595.62, 668.0], [523.24, 661.56], [776.34, 786.29]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[860.89, 877.27], [672.92, 842.81], [818.56, 495.54], [621.37, 702.72], [572.93, 774.42], [841.91, 754.41]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[759.6, 867.06], [685.19, 860.54], [777.71, 582.13], [647.07, 737.35], [622.49, 887.01], [907.32, 722.6]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[706.11, 829.08], [645.0, 908.63], [704.71, 700.98], [672.82, 772.06], [672.17, 999.87], [972.9, 690.72]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[729.13, 818.07], [623.51, 927.86], [602.65, 730.41], [663.41, 838.7], [765.69, 1068.92], [1008.62, 688.69]]) <= 50.0"
] |
ballsim
|
G_3_940
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
145,
94,
62
],
"density": 1,
"position": [
813,
834
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
-160.71,
922.24
]
},
{
"color": [
203,
65,
51
],
"density": 1,
"position": [
593,
707
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
699.01,
-594.33
]
},
{
"color": [
111,
183,
99
],
"density": 1,
"position": [
758,
701
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
-973.31,
134.11
]
},
{
"color": [
205,
136,
217
],
"density": 1,
"position": [
647,
913
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
-820.04,
78.97
]
},
{
"color": [
136,
55,
177
],
"density": 1,
"position": [
810,
953
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
21.9,
-910.87
]
},
{
"color": [
205,
113,
167
],
"density": 1,
"position": [
742,
547
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
208.79,
946.89
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 4
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 940,
"multi_object_count": 6,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 3939365
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 3 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (5 sides), radius 20.0m, initial position (670, 837), initial velocity (-795.65, -396.19) m/s\n- Ball 2: regular polygon (4 sides), radius 20.0m, initial position (747, 712), initial velocity (-103.92, -951.79) m/s\n- Ball 3: regular polygon (3 sides), radius 20.0m, initial position (759, 597), initial velocity (790.9, -579.53) m/s\n- Ball 4: regular polygon (5 sides), radius 20.0m, initial position (609, 785), initial velocity (834.37, 120.21) m/s\n- Ball 5: regular polygon (5 sides), radius 20.0m, initial position (854, 852), initial velocity (299.07, 928.03) m/s\n- Ball 6: regular polygon (6 sides), radius 20.0m, initial position (859, 768), initial velocity (835.98, 539.17) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 6\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[611.25, 861.46], [736.6, 616.81], [788.84, 624.34], [671.62, 732.95], [816.19, 827.5], [942.59, 821.91]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[594.96, 916.46], [710.49, 548.84], [778.2, 721.8], [724.3, 650.35], [750.78, 755.21], [946.63, 737.99]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[643.91, 971.6], [622.65, 587.53], [767.53, 819.51], [773.48, 573.85], [685.21, 682.74], [916.69, 681.75]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[649.75, 952.15], [589.89, 586.03], [756.88, 916.97], [728.29, 660.79], [653.53, 644.18], [828.19, 727.19]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[626.53, 882.38], [627.87, 486.44], [696.61, 928.45], [683.1, 747.73], [708.71, 692.47], [739.69, 772.62]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[582.0, 832.89], [600.01, 587.08], [606.89, 888.93], [637.4, 797.95], [763.89, 740.76], [677.23, 833.08]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[664.81, 808.08], [662.88, 687.71], [627.85, 849.4], [647.75, 773.16], [819.06, 789.05], [682.74, 939.62]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[741.76, 800.97], [707.83, 733.21], [698.91, 842.23], [653.14, 733.17], [874.24, 837.34], [625.87, 904.93]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[853.98, 817.47], [725.97, 696.2], [721.59, 918.86], [658.54, 693.18], [903.88, 817.67], [632.92, 806.32]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[839.75, 833.97], [744.11, 659.19], [712.02, 939.64], [663.94, 653.19], [1029.81, 745.75], [726.7, 707.71]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[825.52, 850.48], [762.25, 565.2], [656.99, 881.68], [669.33, 613.2], [984.94, 727.54], [820.47, 652.95]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[811.28, 866.98], [682.98, 627.28], [601.96, 823.72], [674.73, 573.21], [878.67, 712.83], [859.22, 619.73]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[797.09, 883.45], [599.91, 696.13], [597.97, 765.91], [680.11, 533.32], [821.13, 847.28], [757.63, 616.21]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[686.83, 912.41], [609.04, 725.79], [713.57, 768.53], [663.39, 531.64], [800.61, 867.68], [655.73, 612.79]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[615.13, 890.29], [631.18, 733.68], [862.69, 804.69], [631.45, 556.33], [781.84, 882.72], [611.19, 609.37]]) <= 50.0"
] |
ballsim
|
G_3_800
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
91,
159,
205
],
"density": 1,
"position": [
670,
837
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
-795.65,
-396.19
]
},
{
"color": [
224,
109,
62
],
"density": 1,
"position": [
747,
712
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
-103.92,
-951.79
]
},
{
"color": [
199,
128,
162
],
"density": 1,
"position": [
759,
597
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
790.9,
-579.53
]
},
{
"color": [
168,
207,
203
],
"density": 1,
"position": [
609,
785
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
834.37,
120.21
]
},
{
"color": [
125,
105,
201
],
"density": 1,
"position": [
854,
852
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
299.07,
928.03
]
},
{
"color": [
88,
180,
116
],
"density": 1,
"position": [
859,
768
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
835.98,
539.17
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 3
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 800,
"multi_object_count": 6,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 6597603
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 6 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (4 sides), radius 20.0m, initial position (699, 806), initial velocity (-572.58, 728.85) m/s\n- Ball 2: regular polygon (4 sides), radius 20.0m, initial position (779, 757), initial velocity (-188.21, 823.29) m/s\n- Ball 3: regular polygon (6 sides), radius 20.0m, initial position (900, 834), initial velocity (-890.4, 45.39) m/s\n- Ball 4: regular polygon (6 sides), radius 20.0m, initial position (918, 588), initial velocity (-789.99, 561.73) m/s\n- Ball 5: regular polygon (6 sides), radius 20.0m, initial position (462, 688), initial velocity (737.49, 445.95) m/s\n- Ball 6: regular polygon (6 sides), radius 20.0m, initial position (811, 835), initial velocity (904.91, 215.82) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 6\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[641.75, 878.88], [760.18, 839.32], [901.06, 786.52], [839.0, 644.18], [535.75, 732.6], [811.4, 908.6]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[584.5, 951.75], [741.35, 921.65], [939.29, 717.57], [759.99, 700.35], [609.51, 777.21], [774.64, 1003.67]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[566.96, 1001.8], [710.99, 992.69], [977.62, 648.46], [680.79, 756.67], [683.45, 821.92], [746.62, 1024.73]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[612.25, 1035.11], [628.25, 918.18], [1001.91, 587.56], [601.79, 812.85], [757.2, 866.53], [794.82, 1014.64]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[600.98, 984.5], [602.07, 787.1], [923.1, 586.19], [522.78, 869.02], [830.96, 911.13], [843.01, 1004.56]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[589.7, 894.63], [575.9, 656.02], [844.29, 584.83], [522.35, 879.83], [904.71, 955.74], [891.2, 994.47]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[656.52, 849.86], [549.73, 524.94], [765.48, 583.46], [550.37, 804.8], [978.47, 949.74], [939.4, 1034.99]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[753.76, 822.63], [639.15, 460.61], [686.68, 582.09], [554.99, 716.25], [967.14, 890.52], [878.26, 1016.47]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[851.01, 795.41], [765.73, 472.76], [607.87, 580.72], [559.6, 627.7], [939.01, 821.6], [815.54, 997.03]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[875.08, 725.94], [892.32, 515.63], [602.85, 536.76], [493.02, 583.24], [967.2, 785.2], [752.82, 977.6]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[845.66, 625.57], [982.19, 579.71], [624.36, 477.48], [567.4, 650.82], [1036.57, 772.58], [690.1, 958.17]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[816.24, 525.21], [956.02, 710.79], [645.86, 466.95], [641.79, 718.4], [1095.89, 754.15], [627.38, 938.73]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[786.9, 465.4], [929.91, 841.54], [667.32, 526.09], [716.0, 785.81], [1067.62, 690.58], [564.82, 919.35]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[757.48, 565.76], [903.74, 972.62], [688.83, 585.37], [790.39, 853.38], [1022.02, 636.82], [502.1, 899.91]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[736.45, 670.96], [877.57, 1005.81], [703.89, 640.92], [864.78, 920.96], [976.41, 583.06], [485.83, 853.66]]) <= 50.0"
] |
ballsim
|
G_3_792
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
65,
242,
216
],
"density": 1,
"position": [
699,
806
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
-572.58,
728.85
]
},
{
"color": [
143,
214,
122
],
"density": 1,
"position": [
779,
757
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
-188.21,
823.29
]
},
{
"color": [
105,
217,
169
],
"density": 1,
"position": [
900,
834
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
-890.4,
45.39
]
},
{
"color": [
175,
166,
254
],
"density": 1,
"position": [
918,
588
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
-789.99,
561.73
]
},
{
"color": [
147,
83,
160
],
"density": 1,
"position": [
462,
688
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
737.49,
445.95
]
},
{
"color": [
51,
73,
79
],
"density": 1,
"position": [
811,
835
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
904.91,
215.82
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 6
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 792,
"multi_object_count": 6,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 829267
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 5 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (6 sides), radius 20.0m, initial position (539, 701), initial velocity (-31.31, -833.47) m/s\n- Ball 2: regular polygon (4 sides), radius 20.0m, initial position (598, 772), initial velocity (879.12, 98.54) m/s\n- Ball 3: regular polygon (3 sides), radius 20.0m, initial position (906, 676), initial velocity (398.45, 887.53) m/s\n- Ball 4: regular polygon (5 sides), radius 20.0m, initial position (977, 815), initial velocity (631.6, -617.28) m/s\n- Ball 5: regular polygon (6 sides), radius 20.0m, initial position (720, 750), initial velocity (-39.47, 874.94) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 5\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[535.88, 617.65], [685.92, 781.86], [945.84, 764.75], [1040.17, 753.28], [716.04, 837.5]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[532.75, 534.3], [773.83, 791.73], [985.69, 853.49], [1049.92, 730.37], [712.09, 925.0]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[572.2, 581.8], [861.96, 801.61], [946.46, 884.94], [971.5, 771.47], [708.12, 1012.72]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[618.66, 651.06], [892.55, 868.79], [849.74, 874.47], [941.5, 764.23], [743.38, 979.58]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[665.12, 720.33], [873.31, 985.78], [753.01, 864.0], [953.41, 715.09], [791.62, 906.48]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[711.58, 789.59], [865.82, 1066.64], [656.28, 853.52], [965.33, 665.94], [839.86, 833.39]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[758.04, 858.85], [919.02, 960.68], [559.55, 843.05], [977.24, 616.8], [888.11, 760.29]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[804.5, 928.11], [972.21, 854.72], [462.83, 832.58], [967.36, 583.49], [936.35, 687.2]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[850.96, 997.38], [1025.41, 748.77], [547.15, 822.1], [916.95, 579.63], [984.59, 614.1]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[864.6, 1042.81], [1011.18, 691.81], [643.88, 811.63], [866.53, 575.77], [925.14, 619.25]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[784.37, 1020.05], [893.97, 709.68], [740.61, 801.15], [816.12, 571.92], [840.71, 642.54]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[704.15, 997.27], [776.76, 727.55], [837.34, 790.68], [765.7, 568.06], [756.29, 665.83]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[624.12, 974.55], [659.84, 745.38], [933.82, 780.23], [715.41, 564.21], [672.08, 689.06]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[543.9, 951.77], [542.63, 763.25], [1030.55, 769.76], [665.0, 560.35], [587.65, 712.36]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[469.59, 929.0], [507.85, 781.12], [1089.27, 731.67], [614.58, 556.5], [503.23, 735.65]]) <= 50.0"
] |
ballsim
|
G_3_325
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
169,
145,
124
],
"density": 1,
"position": [
539,
701
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
-31.31,
-833.47
]
},
{
"color": [
90,
234,
135
],
"density": 1,
"position": [
598,
772
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
879.12,
98.54
]
},
{
"color": [
149,
250,
224
],
"density": 1,
"position": [
906,
676
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
398.45,
887.53
]
},
{
"color": [
127,
100,
252
],
"density": 1,
"position": [
977,
815
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
631.6,
-617.28
]
},
{
"color": [
205,
110,
65
],
"density": 1,
"position": [
720,
750
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
-39.47,
874.94
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 5
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 325,
"multi_object_count": 5,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 674320
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 5 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (6 sides), radius 20.0m, initial position (853, 634), initial velocity (833.28, 335.24) m/s\n- Ball 2: regular polygon (5 sides), radius 20.0m, initial position (752, 890), initial velocity (-78.07, 989.25) m/s\n- Ball 3: regular polygon (5 sides), radius 20.0m, initial position (738, 622), initial velocity (-57.55, -928.12) m/s\n- Ball 4: regular polygon (3 sides), radius 20.0m, initial position (529, 809), initial velocity (561.72, -611.17) m/s\n- Ball 5: regular polygon (6 sides), radius 20.0m, initial position (958, 732), initial velocity (603.92, 770.01) m/s\n- Ball 6: regular polygon (5 sides), radius 20.0m, initial position (602, 762), initial velocity (490.26, 864.21) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 6\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[936.33, 667.52], [744.19, 988.93], [732.24, 529.18], [585.18, 747.89], [1018.4, 809.0], [651.02, 848.43]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[1019.65, 701.04], [760.07, 1014.94], [737.83, 471.29], [641.35, 686.78], [980.35, 814.48], [700.05, 934.85]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[1087.56, 746.01], [812.03, 930.11], [787.85, 549.95], [697.67, 625.52], [888.23, 780.75], [749.19, 1021.49]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[1023.67, 784.73], [863.86, 845.49], [837.76, 628.42], [753.85, 564.41], [796.33, 747.11], [821.89, 1035.04]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[936.56, 806.58], [915.69, 760.87], [887.66, 706.89], [810.02, 503.3], [704.44, 713.47], [912.34, 993.95]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[849.45, 828.43], [1029.08, 720.96], [876.01, 740.64], [866.2, 442.18], [612.54, 679.83], [943.64, 909.87]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[762.34, 850.29], [1033.48, 781.65], [849.61, 763.69], [810.54, 462.31], [520.65, 646.18], [954.77, 811.14]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[675.23, 872.14], [966.13, 894.47], [823.22, 786.73], [735.05, 496.85], [504.5, 612.54], [965.91, 712.41]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[588.12, 893.99], [898.77, 1007.29], [796.83, 809.78], [659.56, 531.39], [596.4, 578.9], [977.04, 613.68]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[501.01, 915.84], [855.92, 1044.69], [770.44, 832.83], [740.23, 475.77], [610.21, 590.34], [917.54, 566.27]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[519.36, 937.69], [867.74, 913.83], [744.05, 855.88], [868.24, 440.64], [598.74, 616.39], [820.2, 546.34]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[606.47, 959.54], [879.55, 782.97], [717.66, 878.92], [811.92, 586.42], [587.26, 642.44], [722.86, 526.42]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[693.36, 981.33], [891.34, 652.44], [691.33, 901.91], [755.73, 731.83], [575.82, 668.43], [625.76, 506.55]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[780.47, 1003.18], [903.16, 521.58], [664.94, 924.96], [699.41, 877.61], [564.34, 694.48], [548.05, 547.04]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[867.58, 1025.04], [821.99, 458.26], [595.62, 979.19], [721.67, 966.28], [552.87, 720.53], [481.01, 620.38]]) <= 50.0"
] |
ballsim
|
G_3_580
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
243,
127,
139
],
"density": 1,
"position": [
853,
634
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
833.28,
335.24
]
},
{
"color": [
78,
232,
66
],
"density": 1,
"position": [
752,
890
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
-78.07,
989.25
]
},
{
"color": [
146,
241,
228
],
"density": 1,
"position": [
738,
622
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
-57.55,
-928.12
]
},
{
"color": [
90,
246,
230
],
"density": 1,
"position": [
529,
809
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
561.72,
-611.17
]
},
{
"color": [
225,
222,
135
],
"density": 1,
"position": [
958,
732
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
603.92,
770.01
]
},
{
"color": [
194,
226,
122
],
"density": 1,
"position": [
602,
762
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
490.26,
864.21
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 5
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 580,
"multi_object_count": 6,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 5328456
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 6 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (5 sides), radius 20.0m, initial position (849, 557), initial velocity (772.81, 511.75) m/s\n- Ball 2: regular polygon (3 sides), radius 20.0m, initial position (1024, 645), initial velocity (-868.41, 80.56) m/s\n- Ball 3: regular polygon (6 sides), radius 20.0m, initial position (792, 894), initial velocity (133.36, 876.17) m/s\n- Ball 4: regular polygon (5 sides), radius 20.0m, initial position (649, 555), initial velocity (-133.34, -827.46) m/s\n- Ball 5: regular polygon (6 sides), radius 20.0m, initial position (731, 703), initial velocity (850.27, -46.83) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 5\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[926.27, 608.17], [937.16, 653.06], [805.33, 981.62], [635.67, 472.25], [816.03, 698.31]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[1003.54, 659.34], [850.32, 661.11], [818.66, 1045.63], [622.34, 499.04], [901.07, 693.62]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[1081.02, 710.64], [763.26, 669.19], [832.02, 957.79], [608.98, 581.99], [986.32, 688.93]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[1068.11, 790.27], [676.42, 677.25], [845.35, 870.17], [595.65, 664.73], [1064.86, 687.98]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[985.15, 831.6], [589.58, 685.3], [858.68, 782.55], [582.32, 747.47], [1018.28, 759.26]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[902.19, 872.93], [502.74, 693.36], [872.01, 694.92], [568.99, 830.2], [971.73, 830.55]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[819.23, 914.27], [426.64, 707.62], [885.34, 607.3], [555.66, 912.94], [925.17, 901.84]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[736.27, 955.6], [463.08, 786.84], [898.67, 519.68], [542.33, 995.68], [878.61, 973.13]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[653.31, 996.93], [499.52, 866.07], [912.0, 453.09], [616.89, 1027.68], [832.05, 1044.42]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[672.21, 964.27], [535.96, 945.29], [925.33, 540.71], [593.36, 979.95], [785.5, 999.15]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[700.28, 924.94], [572.42, 1024.51], [938.66, 628.33], [560.65, 869.45], [738.94, 927.86]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[655.69, 843.65], [608.87, 1011.1], [951.99, 715.95], [527.93, 758.95], [758.87, 894.96]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[610.96, 762.4], [645.22, 932.07], [965.29, 803.36], [495.3, 648.73], [778.98, 862.28]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[566.11, 680.96], [681.67, 852.85], [978.62, 890.98], [549.08, 588.16], [799.15, 829.52]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[521.26, 599.51], [718.12, 773.63], [963.53, 962.19], [661.14, 561.23], [819.31, 796.75]]) <= 50.0"
] |
ballsim
|
G_3_967
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
165,
212,
126
],
"density": 1,
"position": [
849,
557
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
772.81,
511.75
]
},
{
"color": [
221,
229,
163
],
"density": 1,
"position": [
1024,
645
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
-868.41,
80.56
]
},
{
"color": [
70,
231,
84
],
"density": 1,
"position": [
792,
894
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
133.36,
876.17
]
},
{
"color": [
180,
113,
116
],
"density": 1,
"position": [
649,
555
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
-133.34,
-827.46
]
},
{
"color": [
150,
95,
55
],
"density": 1,
"position": [
731,
703
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
850.27,
-46.83
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 6
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 967,
"multi_object_count": 5,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 4707379
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 3 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (6 sides), radius 20.0m, initial position (723, 891), initial velocity (-949.67, -265.01) m/s\n- Ball 2: regular polygon (4 sides), radius 20.0m, initial position (745, 792), initial velocity (-275.86, 865.75) m/s\n- Ball 3: regular polygon (5 sides), radius 20.0m, initial position (807, 839), initial velocity (-633.01, 634.02) m/s\n- Ball 4: regular polygon (6 sides), radius 20.0m, initial position (851, 658), initial velocity (914.39, -165.33) m/s\n- Ball 5: regular polygon (4 sides), radius 20.0m, initial position (767, 751), initial velocity (-517.18, 852.43) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 5\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[628.03, 864.51], [717.41, 878.57], [743.69, 902.4], [919.72, 680.81], [715.29, 836.25]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[631.96, 838.02], [659.43, 934.75], [699.75, 970.84], [951.11, 768.27], [647.71, 905.63]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[727.17, 811.47], [599.3, 989.06], [640.99, 974.66], [942.04, 785.7], [646.91, 913.34]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[822.14, 784.98], [603.51, 1005.92], [580.59, 975.37], [882.01, 714.78], [776.6, 920.61]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[917.11, 758.49], [655.94, 990.33], [586.64, 909.64], [821.97, 643.86], [844.26, 820.46]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[1012.08, 732.0], [684.22, 928.08], [598.18, 838.4], [761.94, 572.94], [902.8, 704.51]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[1035.41, 753.15], [712.49, 865.82], [609.73, 767.16], [678.69, 542.24], [886.04, 719.02]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[964.98, 684.15], [740.76, 803.56], [621.28, 695.92], [587.25, 525.71], [814.9, 827.71]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[872.99, 652.51], [769.03, 741.31], [632.83, 624.68], [668.54, 510.33], [743.75, 936.4]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[778.02, 626.02], [797.3, 679.05], [644.38, 553.43], [699.93, 597.78], [625.92, 964.21]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[712.16, 582.72], [825.57, 616.8], [638.96, 511.57], [702.22, 702.04], [668.78, 971.49]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[662.62, 529.98], [802.81, 642.9], [583.03, 557.2], [688.18, 815.74], [746.29, 888.39]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[613.0, 477.74], [763.11, 698.36], [630.15, 602.72], [674.18, 929.15], [804.69, 772.74]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[603.62, 493.83], [723.32, 753.95], [686.08, 648.35], [618.95, 971.49], [863.24, 656.79]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[624.52, 563.1], [683.52, 809.54], [742.02, 693.98], [651.54, 926.79], [824.93, 708.61]]) <= 50.0"
] |
ballsim
|
G_3_576
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
134,
250,
136
],
"density": 1,
"position": [
723,
891
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
-949.67,
-265.01
]
},
{
"color": [
224,
179,
183
],
"density": 1,
"position": [
745,
792
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
-275.86,
865.75
]
},
{
"color": [
87,
70,
50
],
"density": 1,
"position": [
807,
839
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
-633.01,
634.02
]
},
{
"color": [
250,
155,
176
],
"density": 1,
"position": [
851,
658
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
914.39,
-165.33
]
},
{
"color": [
255,
136,
62
],
"density": 1,
"position": [
767,
751
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
-517.18,
852.43
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 3
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 576,
"multi_object_count": 5,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 3046610
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 6 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (3 sides), radius 20.0m, initial position (939, 680), initial velocity (-53.71, -886.98) m/s\n- Ball 2: regular polygon (3 sides), radius 20.0m, initial position (682, 705), initial velocity (446.96, -715.58) m/s\n- Ball 3: regular polygon (4 sides), radius 20.0m, initial position (838, 847), initial velocity (828.51, 324.31) m/s\n- Ball 4: regular polygon (6 sides), radius 20.0m, initial position (827, 745), initial velocity (827.07, -241.51) m/s\n- Ball 5: regular polygon (6 sides), radius 20.0m, initial position (799, 555), initial velocity (-819.19, -490.2) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 5\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[933.63, 591.3], [726.7, 633.44], [920.86, 879.42], [909.71, 720.85], [717.09, 505.98]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[928.26, 502.61], [771.4, 561.88], [1003.72, 911.84], [992.43, 696.71], [635.18, 456.95]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[922.87, 471.45], [816.22, 490.15], [945.78, 862.94], [1052.69, 685.58], [553.07, 477.33]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[917.5, 560.15], [860.92, 466.55], [876.27, 807.4], [990.43, 745.13], [550.63, 572.25]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[912.13, 648.84], [905.62, 538.11], [806.77, 751.86], [928.15, 804.67], [549.14, 667.7]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[906.76, 737.54], [950.32, 609.67], [737.26, 696.31], [865.86, 864.22], [547.65, 763.16]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[901.39, 826.24], [995.03, 681.22], [667.75, 640.77], [803.58, 923.77], [546.16, 858.62]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[896.02, 914.93], [1039.72, 752.78], [598.25, 585.23], [741.3, 983.31], [544.67, 954.08]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[890.65, 1003.63], [1050.9, 805.0], [528.74, 529.69], [679.02, 1042.87], [580.34, 1028.09]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[885.28, 1022.51], [966.57, 802.07], [601.8, 556.45], [708.91, 1049.22], [571.6, 1021.31]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[879.9, 933.82], [882.25, 799.14], [684.67, 588.88], [801.8, 1019.19], [540.19, 954.89]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[874.53, 845.12], [797.92, 796.21], [767.53, 621.3], [894.7, 989.16], [538.7, 871.2]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[869.18, 756.65], [713.81, 793.29], [850.18, 653.64], [982.62, 956.47], [537.22, 787.71]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[863.8, 667.95], [629.48, 790.36], [933.04, 686.06], [962.19, 861.02], [535.73, 704.02]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[858.43, 579.25], [545.15, 787.43], [1015.9, 718.48], [941.75, 765.56], [534.24, 620.33]]) <= 50.0"
] |
ballsim
|
G_3_988
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
55,
95,
173
],
"density": 1,
"position": [
939,
680
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
-53.71,
-886.98
]
},
{
"color": [
247,
54,
245
],
"density": 1,
"position": [
682,
705
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
446.96,
-715.58
]
},
{
"color": [
220,
91,
164
],
"density": 1,
"position": [
838,
847
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
828.51,
324.31
]
},
{
"color": [
92,
106,
66
],
"density": 1,
"position": [
827,
745
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
827.07,
-241.51
]
},
{
"color": [
221,
69,
161
],
"density": 1,
"position": [
799,
555
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
-819.19,
-490.2
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 6
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 988,
"multi_object_count": 5,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 4524572
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 6 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (4 sides), radius 20.0m, initial position (849, 556), initial velocity (-794.31, -399.82) m/s\n- Ball 2: regular polygon (3 sides), radius 20.0m, initial position (812, 775), initial velocity (26.02, 915.67) m/s\n- Ball 3: regular polygon (3 sides), radius 20.0m, initial position (963, 803), initial velocity (-127.62, 931.1) m/s\n- Ball 4: regular polygon (5 sides), radius 20.0m, initial position (537, 883), initial velocity (591.43, 759.0) m/s\n- Ball 5: regular polygon (5 sides), radius 20.0m, initial position (847, 820), initial velocity (291.45, 924.71) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 5\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[769.58, 516.01], [814.61, 866.58], [950.23, 896.12], [596.13, 958.9], [876.15, 912.48]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[690.16, 476.03], [817.22, 958.15], [937.46, 989.23], [655.26, 1034.8], [905.3, 1004.96]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[610.54, 454.54], [819.84, 1049.95], [947.2, 979.97], [714.54, 1000.58], [870.38, 1039.92]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[548.2, 504.38], [774.62, 1056.16], [994.68, 882.51], [773.67, 924.67], [814.73, 961.28]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[553.28, 593.16], [717.34, 1046.59], [1042.16, 785.05], [821.82, 814.93], [776.64, 905.08]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[558.36, 681.92], [660.07, 1034.48], [1058.62, 705.49], [866.47, 694.42], [742.04, 859.65]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[563.44, 770.69], [602.79, 1022.37], [950.46, 697.87], [911.12, 573.91], [707.45, 814.21]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[568.52, 859.46], [545.52, 1010.24], [842.31, 690.25], [922.74, 472.48], [672.85, 768.78]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[580.09, 936.99], [553.28, 972.11], [734.15, 682.63], [796.05, 450.9], [638.26, 723.35]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[637.0, 936.01], [610.53, 985.99], [635.93, 675.02], [669.37, 459.22], [598.24, 677.91]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[693.91, 935.03], [712.82, 973.86], [622.91, 667.4], [558.75, 490.08], [511.67, 632.48]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[750.82, 934.06], [815.12, 961.72], [609.9, 659.78], [603.41, 610.59], [525.55, 645.03]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[807.59, 933.08], [917.16, 949.62], [597.57, 787.31], [667.28, 671.27], [588.3, 682.84]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[864.49, 932.11], [985.39, 917.82], [617.27, 961.62], [734.64, 721.86], [630.36, 705.59]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[921.4, 931.13], [944.74, 823.17], [636.97, 978.92], [802.0, 772.44], [672.43, 728.34]]) <= 50.0"
] |
ballsim
|
G_3_841
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
55,
64,
189
],
"density": 1,
"position": [
849,
556
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
-794.31,
-399.82
]
},
{
"color": [
135,
211,
230
],
"density": 1,
"position": [
812,
775
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
26.02,
915.67
]
},
{
"color": [
138,
83,
59
],
"density": 1,
"position": [
963,
803
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
-127.62,
931.1
]
},
{
"color": [
100,
210,
115
],
"density": 1,
"position": [
537,
883
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
591.43,
759
]
},
{
"color": [
193,
110,
96
],
"density": 1,
"position": [
847,
820
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
291.45,
924.71
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 6
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 841,
"multi_object_count": 5,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 9151730
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 4 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (4 sides), radius 20.0m, initial position (955, 676), initial velocity (552.59, -580.48) m/s\n- Ball 2: regular polygon (3 sides), radius 20.0m, initial position (804, 736), initial velocity (-833.21, 380.29) m/s\n- Ball 3: regular polygon (4 sides), radius 20.0m, initial position (866, 713), initial velocity (4.83, -901.88) m/s\n- Ball 4: regular polygon (3 sides), radius 20.0m, initial position (808, 922), initial velocity (641.09, 508.39) m/s\n- Ball 5: regular polygon (5 sides), radius 20.0m, initial position (767, 701), initial velocity (781.9, -364.53) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 5\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[972.93, 655.26], [720.67, 774.04], [866.49, 622.81], [872.11, 972.83], [845.2, 664.55]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[914.87, 710.51], [637.35, 812.07], [866.98, 532.63], [831.33, 918.76], [923.4, 628.1]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[856.67, 765.9], [553.82, 850.21], [797.19, 512.49], [780.37, 854.49], [941.34, 652.01]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[798.61, 821.15], [540.58, 818.16], [707.01, 512.98], [729.54, 790.38], [904.89, 730.2]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[740.56, 876.4], [578.61, 734.83], [631.55, 528.19], [678.71, 726.27], [868.44, 808.4]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[682.5, 931.65], [597.87, 651.51], [631.06, 618.38], [646.66, 662.16], [831.99, 886.6]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[631.91, 979.43], [525.44, 664.01], [627.86, 629.58], [747.58, 660.93], [795.54, 964.8]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[687.16, 921.37], [534.11, 789.5], [630.28, 625.67], [855.81, 667.01], [759.09, 1042.99]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[742.41, 863.32], [567.32, 890.44], [632.7, 621.76], [964.04, 673.09], [774.13, 1069.68]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[797.66, 805.26], [692.81, 899.11], [635.12, 617.86], [1034.16, 717.28], [816.56, 997.47]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[852.91, 747.2], [817.67, 906.69], [637.53, 613.95], [1029.48, 814.72], [853.35, 919.87]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[908.15, 689.15], [865.74, 781.23], [639.95, 610.04], [921.26, 808.64], [932.11, 914.96]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[963.27, 631.24], [913.7, 656.08], [642.36, 606.15], [813.3, 802.58], [939.72, 839.11]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[928.15, 663.54], [885.6, 606.78], [644.78, 602.24], [705.07, 796.5], [944.63, 760.35]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[870.1, 718.79], [760.14, 654.85], [647.19, 598.34], [596.84, 790.42], [949.54, 681.59]]) <= 50.0"
] |
ballsim
|
G_3_370
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
65,
134,
230
],
"density": 1,
"position": [
955,
676
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
552.59,
-580.48
]
},
{
"color": [
220,
217,
71
],
"density": 1,
"position": [
804,
736
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
-833.21,
380.29
]
},
{
"color": [
80,
138,
76
],
"density": 1,
"position": [
866,
713
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
4.83,
-901.88
]
},
{
"color": [
159,
247,
231
],
"density": 1,
"position": [
808,
922
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
641.09,
508.39
]
},
{
"color": [
219,
64,
125
],
"density": 1,
"position": [
767,
701
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
781.9,
-364.53
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 4
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 370,
"multi_object_count": 5,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 9112988
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 6 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (4 sides), radius 20.0m, initial position (619, 953), initial velocity (-472.82, -835.41) m/s\n- Ball 2: regular polygon (3 sides), radius 20.0m, initial position (558, 693), initial velocity (-516.37, -746.22) m/s\n- Ball 3: regular polygon (6 sides), radius 20.0m, initial position (849, 839), initial velocity (-737.19, -446.43) m/s\n- Ball 4: regular polygon (5 sides), radius 20.0m, initial position (975, 697), initial velocity (629.59, 703.04) m/s\n- Ball 5: regular polygon (6 sides), radius 20.0m, initial position (742, 752), initial velocity (-784.6, -280.6) m/s\n- Ball 6: regular polygon (4 sides), radius 20.0m, initial position (676, 606), initial velocity (64.04, 797.63) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 6\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[571.71, 869.46], [506.36, 618.37], [775.27, 794.35], [1037.96, 767.31], [663.53, 723.95], [682.4, 685.76]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[524.42, 785.91], [543.78, 595.15], [725.29, 763.41], [1031.14, 797.35], [585.07, 695.9], [657.94, 747.71]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[477.02, 702.16], [634.46, 602.56], [750.77, 776.04], [938.55, 777.94], [506.4, 667.77], [535.25, 753.15]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[476.9, 708.44], [724.92, 609.96], [776.18, 788.64], [846.19, 758.58], [485.23, 624.61], [412.87, 758.57]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[554.97, 774.51], [815.37, 617.36], [801.6, 801.23], [753.83, 739.22], [562.56, 627.03], [459.37, 666.48]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[633.05, 840.57], [905.83, 624.76], [827.01, 813.83], [661.47, 719.86], [639.88, 629.44], [525.24, 563.21]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[711.13, 906.63], [996.28, 632.15], [852.43, 826.43], [569.11, 700.5], [717.2, 631.86], [591.11, 459.93]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[789.2, 972.7], [1018.47, 678.96], [877.84, 839.03], [476.75, 681.14], [794.52, 634.28], [656.98, 533.85]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[867.28, 1038.76], [979.68, 760.99], [903.26, 851.62], [481.19, 717.66], [871.83, 636.69], [722.85, 637.13]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[945.36, 1004.67], [956.45, 834.04], [920.89, 868.71], [544.15, 787.98], [949.15, 639.11], [788.72, 740.4]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[982.44, 914.94], [1021.95, 855.84], [894.16, 911.41], [607.11, 858.29], [1026.47, 641.53], [854.59, 843.67]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[979.03, 814.31], [1036.46, 829.0], [867.43, 980.36], [670.08, 928.6], [1013.73, 695.96], [920.45, 912.87]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[913.53, 730.55], [1069.38, 783.29], [840.76, 1039.33], [732.88, 998.74], [999.42, 751.18], [986.16, 947.62]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[794.31, 677.5], [1095.43, 741.48], [814.03, 943.92], [795.85, 1042.41], [1026.3, 782.75], [930.14, 912.09]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[675.1, 624.45], [1039.23, 747.17], [787.29, 848.51], [858.81, 972.09], [1053.16, 814.31], [867.03, 872.47]]) <= 50.0"
] |
ballsim
|
G_3_28
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
194,
116,
183
],
"density": 1,
"position": [
619,
953
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
-472.82,
-835.41
]
},
{
"color": [
71,
77,
92
],
"density": 1,
"position": [
558,
693
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
-516.37,
-746.22
]
},
{
"color": [
203,
83,
132
],
"density": 1,
"position": [
849,
839
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
-737.19,
-446.43
]
},
{
"color": [
204,
181,
246
],
"density": 1,
"position": [
975,
697
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
629.59,
703.04
]
},
{
"color": [
61,
94,
97
],
"density": 1,
"position": [
742,
752
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
-784.6,
-280.6
]
},
{
"color": [
186,
213,
142
],
"density": 1,
"position": [
676,
606
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
64.04,
797.63
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 6
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 28,
"multi_object_count": 6,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 525826
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 6 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (5 sides), radius 20.0m, initial position (880, 1017), initial velocity (-442.04, -714.42) m/s\n- Ball 2: regular polygon (6 sides), radius 20.0m, initial position (630, 685), initial velocity (-918.36, -76.03) m/s\n- Ball 3: regular polygon (5 sides), radius 20.0m, initial position (784, 841), initial velocity (-836.46, -137.94) m/s\n- Ball 4: regular polygon (4 sides), radius 20.0m, initial position (661, 587), initial velocity (-22.82, -958.46) m/s\n- Ball 5: regular polygon (4 sides), radius 20.0m, initial position (902, 622), initial velocity (914.26, 335.31) m/s\n- Ball 6: regular polygon (4 sides), radius 20.0m, initial position (749, 885), initial velocity (-467.1, -845.34) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 6\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[835.79, 945.56], [538.15, 677.41], [735.37, 792.2], [658.73, 491.15], [993.43, 655.52], [660.67, 842.08]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[791.57, 874.13], [446.32, 669.81], [700.92, 729.21], [656.46, 495.2], [1062.27, 702.08], [555.47, 816.03]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[747.25, 802.51], [491.43, 741.4], [666.39, 666.06], [654.18, 591.29], [1045.58, 798.27], [450.01, 789.92]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[703.03, 731.08], [543.93, 817.13], [666.19, 708.51], [611.18, 561.79], [1018.13, 887.98], [432.11, 713.47]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[759.95, 733.12], [596.42, 892.86], [576.08, 711.97], [554.86, 491.31], [943.37, 950.38], [483.26, 621.53]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[822.42, 739.2], [648.91, 968.59], [480.4, 711.38], [628.33, 495.76], [868.61, 1012.78], [558.41, 543.45]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[884.9, 745.27], [701.4, 1044.33], [438.56, 741.88], [717.54, 509.3], [793.86, 1034.31], [633.56, 465.38]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[947.37, 751.35], [728.13, 1020.56], [486.91, 824.45], [806.75, 522.85], [752.58, 938.43], [708.7, 503.2]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[1009.85, 757.43], [719.49, 1005.99], [535.26, 907.02], [895.96, 536.4], [757.26, 796.59], [783.85, 581.28]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[1072.34, 763.51], [710.85, 991.41], [583.6, 989.59], [985.17, 549.95], [761.95, 654.74], [859.0, 659.35]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[1073.09, 733.95], [702.2, 976.84], [631.94, 1039.3], [958.76, 630.24], [766.64, 512.9], [934.14, 737.43]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[1036.57, 682.87], [715.01, 949.88], [656.85, 970.27], [925.88, 714.27], [771.33, 519.45], [1009.29, 815.51]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[1000.15, 631.93], [775.21, 895.59], [629.89, 931.33], [893.07, 798.09], [776.0, 660.94], [991.18, 839.65]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[963.65, 580.85], [835.56, 841.17], [602.86, 892.29], [860.19, 882.13], [780.69, 802.78], [885.98, 813.6]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[927.15, 529.78], [824.9, 857.77], [575.84, 853.25], [827.3, 966.16], [785.38, 944.63], [873.03, 695.3]]) <= 50.0"
] |
ballsim
|
G_3_727
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
198,
84,
204
],
"density": 1,
"position": [
880,
1017
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
-442.04,
-714.42
]
},
{
"color": [
189,
175,
148
],
"density": 1,
"position": [
630,
685
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
-918.36,
-76.03
]
},
{
"color": [
71,
65,
53
],
"density": 1,
"position": [
784,
841
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
-836.46,
-137.94
]
},
{
"color": [
83,
253,
250
],
"density": 1,
"position": [
661,
587
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
-22.82,
-958.46
]
},
{
"color": [
117,
177,
179
],
"density": 1,
"position": [
902,
622
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
914.26,
335.31
]
},
{
"color": [
213,
247,
148
],
"density": 1,
"position": [
749,
885
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 4,
"velocity": [
-467.1,
-845.34
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 6
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 727,
"multi_object_count": 6,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 6493945
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
[
{
"content": "## Polygon Dynamics Prediction\nIn this task, you will implement a single function predict_position(t) that computes the 2D positions of all balls at an arbitrary future time t under idealized mechanics. The function parses the scene configuration (containers, balls, and physics/meta), reconstructs the motions, detects and handles boundary collisions with finite-size treatment, and returns a list where each element is the [x, y] position (rounded to 2 decimals) of a ball at time t. Each evaluation of t must be computed directly from initial conditions and scene mechanics with no hidden state or accumulation across calls. Rendering, animation, and explanatory text are out of scope; prefer closed-form reasoning and avoid coarse time-stepping except where narrowly required for collision resolution.\n\n### Mechanics (General)\n- Kinematics: Use closed-form equations under constant acceleration: x(t)=x0+vx0*t+0.5*ax*t^2, y(t)=y0+vy0*t+0.5*ay*t^2.\n- Collisions: Perfectly elastic. Reflect velocity using v' = v - 2·dot(v, n̂)·n̂, where n̂ is the inward unit normal at the contact.\n- Finite size: Use polygon–polygon contact. Derive regular shapes from ('sides','radius','center','rotation'); irregular convex polygon balls use provided vertices.\n- Geometry: Irregular convex polygons (if present) are simple (non self-intersecting). Ball finite size must be respected in all interactions.\n- Units: Positions in meters; time in seconds; angles in radians; velocities in m/s; accelerations in m/s^2.\n- Cartesian Axes: +X is right, +Y is up.\n\n### Constraints\n- Implement only predict_position(t); no other entry points will be called.\n- No global variables; no variables defined outside the function.\n- Do not import external libraries (except math); do not perform I/O; do not print; do not use randomness.\n- Numerical output must be round(value, 2); normalize -0.0 to 0.0.\n\n### Verification and output contract\n- Return a list of positions per ball for the provided t: [[x1,y1],[x2,y2],...].\n- Each call must be computed independently (no state carry-over between calls).\n- You should assume that the ball will hit the wall and bounce back, which will be verified in test cases. \n\n\n### Scene description\n#### Containers\n- Container 1: regular polygon with 4 sides, radius 375.00m, center at (750, 750); initial orientation 0.000 rad\n\n#### Objects\n- Ball 1: regular polygon (6 sides), radius 20.0m, initial position (660, 775), initial velocity (-474.21, -781.74) m/s\n- Ball 2: regular polygon (6 sides), radius 20.0m, initial position (799, 769), initial velocity (-65.33, 981.05) m/s\n- Ball 3: regular polygon (6 sides), radius 20.0m, initial position (844, 902), initial velocity (692.54, -451.42) m/s\n- Ball 4: regular polygon (5 sides), radius 20.0m, initial position (571, 899), initial velocity (-655.6, 747.69) m/s\n- Ball 5: regular polygon (3 sides), radius 20.0m, initial position (700, 834), initial velocity (-828.18, -207.91) m/s\n- Ball 6: regular polygon (5 sides), radius 20.0m, initial position (910, 807), initial velocity (666.63, -519.61) m/s\n\n### Physics\n- no effective gravity (treated as zero).\n\n### Dynamics\n- No additional time-varying mechanisms.\n\n### Conventions for this scene\n- Containers are convex regular polygons (parameters: 'sides', 'radius', 'center'), unless otherwise specified.\n- Angle baseline: By default, the initial orientation is 0.000 rad, pointing to the first vertex along +X (standard Cartesian axes); positive angles rotate CCW about the container center.\n- Polygon vertices (if provided) are CCW and form a simple convex polygon.\n- Container 'radius' denotes the circumradius (meters).\n- For balls: irregular convex polygons rely on provided vertices (no radius mentioned); regular polygons may be derived from 'sides/radius/center/rotation'.\n- Containers are kinematic (infinite mass, prescribed motion); impacts do not alter container motion.\n\n### Task\n- Number of balls: 6\n- Your should think step by step and write python code.\n- The final output should be in the following format: \n[Your thinking steps here ...](optional)\n```python\n[Your Python code here]\n```\n- Define predict_position(t) returning a list of length n_balls; each element is [x_i, y_i] (rounded to 2 decimals) for Ball i at time t (seconds)\n\n### Output\n- Required format: function predict_position(t: float) -> [[x1,y1],[x2,y2],...]; coordinates as 2-decimal floats",
"role": "user"
}
] |
[
"assert check_distance(predict_position(0.10), [[612.59, 696.83], [792.46, 867.1], [913.26, 856.86], [626.73, 852.5], [617.19, 813.2], [976.67, 755.05]]) <= 50.0",
"assert check_distance(predict_position(0.20), [[565.18, 618.65], [785.91, 965.19], [982.53, 811.72], [701.51, 786.95], [534.38, 792.4], [1043.34, 703.09]]) <= 50.0",
"assert check_distance(predict_position(0.30), [[612.05, 634.69], [779.35, 1063.53], [1051.95, 766.46], [776.48, 721.23], [451.36, 771.55], [1000.8, 760.4]]) <= 50.0",
"assert check_distance(predict_position(0.40), [[690.23, 682.1], [727.19, 1033.7], [1068.98, 773.53], [851.26, 655.68], [436.13, 749.25], [948.84, 827.07]]) <= 50.0",
"assert check_distance(predict_position(0.50), [[768.4, 729.51], [733.73, 935.61], [1004.88, 823.84], [926.04, 590.13], [518.94, 770.05], [896.89, 893.75]]) <= 50.0",
"assert check_distance(predict_position(0.60), [[846.57, 776.93], [740.27, 837.51], [935.62, 868.98], [874.36, 651.03], [601.75, 790.85], [844.94, 960.42]]) <= 50.0",
"assert check_distance(predict_position(0.70), [[924.75, 824.34], [746.82, 739.42], [866.36, 914.12], [808.81, 725.81], [684.56, 811.65], [792.98, 1027.1]]) <= 50.0",
"assert check_distance(predict_position(0.80), [[975.92, 844.75], [753.36, 641.32], [797.09, 959.26], [744.72, 796.07], [764.69, 840.73], [746.7, 1088.08]]) <= 50.0",
"assert check_distance(predict_position(0.90), [[928.51, 766.58], [759.9, 543.22], [727.83, 1004.4], [700.39, 805.52], [808.66, 981.06], [813.37, 1036.13]]) <= 50.0",
"assert check_distance(predict_position(1.00), [[881.1, 688.4], [766.45, 445.12], [701.88, 1006.24], [656.05, 814.97], [783.76, 909.41], [766.49, 948.81]]) <= 50.0",
"assert check_distance(predict_position(1.10), [[833.68, 610.23], [727.02, 457.65], [747.03, 936.97], [611.72, 824.42], [747.97, 804.24], [703.65, 857.89]]) <= 50.0",
"assert check_distance(predict_position(1.20), [[786.27, 532.05], [720.47, 555.75], [792.17, 867.71], [567.38, 833.87], [712.18, 699.06], [640.81, 766.98]]) <= 50.0",
"assert check_distance(predict_position(1.30), [[738.98, 454.08], [734.87, 617.37], [837.2, 798.62], [523.16, 843.29], [634.63, 666.62], [578.12, 676.29]]) <= 50.0",
"assert check_distance(predict_position(1.40), [[776.43, 460.78], [782.14, 622.27], [882.34, 729.36], [505.69, 825.87], [491.22, 747.82], [567.58, 637.67]]) <= 50.0",
"assert check_distance(predict_position(1.50), [[854.61, 508.2], [829.4, 627.18], [927.48, 660.1], [515.14, 781.53], [481.36, 695.48], [658.5, 700.51]]) <= 50.0"
] |
ballsim
|
G_3_38
| 3
|
[
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
1,
1.1,
1.2,
1.3,
1.4,
1.5
] |
{
"balls": [
{
"color": [
181,
174,
238
],
"density": 1,
"position": [
660,
775
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
-474.21,
-781.74
]
},
{
"color": [
65,
94,
219
],
"density": 1,
"position": [
799,
769
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
-65.33,
981.05
]
},
{
"color": [
96,
197,
113
],
"density": 1,
"position": [
844,
902
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 6,
"velocity": [
692.54,
-451.42
]
},
{
"color": [
138,
51,
175
],
"density": 1,
"position": [
571,
899
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
-655.6,
747.69
]
},
{
"color": [
69,
122,
128
],
"density": 1,
"position": [
700,
834
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 3,
"velocity": [
-828.18,
-207.91
]
},
{
"color": [
182,
121,
239
],
"density": 1,
"position": [
910,
807
],
"radius": 20,
"restitution": 1,
"rotation_affected": false,
"sides": 5,
"velocity": [
666.63,
-519.61
]
}
],
"boxes": [
{
"center": [
750,
750
],
"diameter": 750,
"friction": 0,
"restitution": 1,
"rotation": 0,
"rotation_speed": 0,
"sides": 4
}
],
"meta": {
"difficulty": "hard",
"difficulty_config": {
"description": "Hard: 小空间,复杂布局,高密度,频繁碰撞"
},
"difficulty_level": 3,
"generation_config": {
"multi_container_config": {
"min_gap": 50
}
},
"index": 38,
"multi_object_count": 6,
"scene_space": {
"center": [
750,
750
],
"height": 1500,
"units": "meters",
"width": 1500
},
"scene_type": "G",
"seed": 7634147
},
"physics": {
"gravity_enabled": false,
"gravity_x": 0,
"gravity_y": 0
}
}
| 50
|
function
|
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 4