evaluate module

evaluate.evaluate(model, algorithm, graphics=False, robot=None, save_postfix=None, passive=True)

This function evaluate an algorithm’s performance on a given model. To avoid repeated test, the algorithm will examine whether the results already exist. If they do, it will return the results directly. Which also means if you updated some algorithm, you need to delete previous results manually to see the changes.

Parameters
  • model (str) – the name of the model to be tested

  • algorithm (str) – the name of the algorithm to be tested

  • graphics (bool) – whether to use graphics to show the evaluation process on live

  • robot (KinematicModel) – you can pass in an initialized agent with a given setting, or the function will use a default one. This is useful when you grid search the parameters.

  • save_postfix (str) – a string to specify the name of the results

  • passive (bool) – whether the human model is passive to the robot’s behavior. If is ture, human model will not react to the robot.

Returns

A dict contains the algorithm’s average score on different aspects, include safety, efficiency, collision count, and nearest distance.

Return type

total_score (dict)

evaluate.save_data(folder, name, record)

This function saves the results.

Parameters
  • folder – folder path

  • name – file name

  • record – evaluation result