Header menu logo PhysicsSandbox

BatchOperations Module

Batch command execution with automatic chunking and failure reporting.

Types

Type Description

BatchResult

Aggregated result of a batch operation across all chunks.

Functions and values

Function or value Description

batchAdd arg1 arg2

Full Usage: batchAdd arg1 arg2

Parameters:
Returns: BatchResult A BatchResult summarizing how many commands succeeded and which failed.

Sends a list of simulation commands in batches of 100, logging any failures to the console.

Per-command failures are logged as [BATCH FAIL] command N: error message. Common failures: duplicate body ID, unknown body ID for impulse/torque, invalid shape.

arg0 : Session
arg1 : SimulationCommand list
Returns: BatchResult

A BatchResult summarizing how many commands succeeded and which failed.

Example

 let cmds = [ for i in 1..200 ->
     makeSphereCmd (nextId "sphere") (0.0, float i * 0.5, 0.0) 0.3 1.0 ]
 let result = batchAdd session cmds   // sent in 2 automatic batches of 100
 printfn "%d succeeded, %d failed" result.Succeeded result.Failed.Length
val cmds: obj list
val i: int
Multiple items
val float: value: 'T -> float (requires member op_Explicit)

--------------------
type float = System.Double

--------------------
type float<'Measure> = float
val result: obj
val printfn: format: Printf.TextWriterFormat<'T> -> 'T

Type something to start searching.