Next: libsnd, Previous: libscm, Up: C API

### 5.33 libsim

#### 5.33.1 Overview

View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/sim/index.html.

#### 5.33.2 API

— Function: void lw6sim_print (lw6sim_results_t * results, FILE * f)

> results: data to print

> f: file to print data to

> Pretty prints results on standard output.

> Return value: none.

— Function: void lw6sim_results_zero (lw6sim_results_t * results)

> results: out param, will be cleared

> Fills the struct with zeroes.

> Return value: none.

— Function: int lw6sim_results_update_percents (lw6sim_results_t * results)

> results: results set to work on (in/out param)

> Updates the structure so that the percent members are up to date.

> Return value: 1 on success, 0 on failure.

— Function: int lw6sim_simulate (int argc, char * [] argv, lw6sim_results_t * results, int nb_teams, char * bot_backend)

> argc: argc as passed to `main`

> argv: argv as passed to `main`

> results: out param, results of the simulation

> nb_teams: number of teams

> bot_backend: bot backend to use

> Runs a simulation of several battle/games on the default map using different team settings. Will test teams up to the given number, for instance if you give 3 as an argument, will run tests with teams 0, 1 and 2 (that's to say a total of 3 teams).

> Return value: 1 on success, 0 on failure.

— Function: int lw6sim_simulate_basic (int argc, char * [] argv, lw6sim_results_t * results)

> argc: argc as passed to `main`

> argv: argv as passed to `main`

> results: out param, results of the simulation

> Runs a simulation of several battle/games on the default map using different team settings. Will test the most common colors only, with the most popular bot.

> Return value: 1 on success, 0 on failure.

— Function: int lw6sim_simulate_full (int argc, char * [] argv, lw6sim_results_t * results)

> argc: argc as passed to `main`

> argv: argv as passed to `main`

> results: out param, results of the simulation

> Runs a simulation of several battle/games on the default map using different team settings. Will test all colors, with the most popular bot.

> Return value: 1 on success, 0 on failure.

— Function: int lw6sim_test (int mode)

> mode: 0 for check only, 1 for full test

> Runs the `sim` module test suite.

> Return value: 1 if test is successfull, 0 on error.