Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

rt::TopManager Class Reference

Manages a top mode tournament. More...

#include <robtopmgr.h>

Inheritance diagram for rt::TopManager:

Inheritance graph
[legend]
List of all members.

Public Methods

 TopManager (bool importOld, int size, const String &competitionFolder)
 Creates a new TopManager. More...

virtual ~TopManager ()
virtual void setup (SimOptions *const options)
 creates supervisors, results and programs.

virtual void run ()
String getResultFileName (const String &botname)
String getInfoFileName (const String &botname)
String getId (const String &botname)
bool setIfInTop (const String &botname, const String &top)
bool saveRes (const String &bot1, const String &bot2, int wins, int looses, int ties)
TopInfo * updateBotInfo (const String &botname)
bool doFights (const String &botname)
void readCharts (const IniFile &charts, Vector< TopTourResult > &store)
 Reads the charts ini file into the given store, which is cleared first. More...

void calcCharts (const IniFile &charts, Vector< TopTourResult > &store)
 Calculates the charts store from the results files. More...

void sortCharts (Vector< TopTourResult > &store)
 Sorts the store so that it is ordered after points, highest first.

void checkChartsLength (IniFile &charts, Vector< TopTourResult > &store)
 Removes all entries from the store and the charts which are not eligible for the charts anymore.

bool updateCharts (IniFile &charts, const Array< TopTourResult > &store)
 Updates the charts with the values from the given store.

bool addAndCheck (const String &botname)
 Try to add a program to the currently loaded programs. More...


Protected Methods

TourInitInfo getTourInitInfo ()

Detailed Description

Manages a top mode tournament.

Can replace RobServ.


Constructor & Destructor Documentation

rt::TopManager::TopManager (  bool    importOld,
int    size,
const String &    competitionFolder
) 
 

Creates a new TopManager.

Parameters:
importOld  Whether old, partial results from a previous run of robotour should be used.
size  The chart size for this competition.
competitionFolder  The folder in which the result files should be stored.


Member Function Documentation

bool rt::TopManager::addAndCheck (  const String &    botname ) 
 

Try to add a program to the currently loaded programs.

Checks if the new program can be assembled correctly. If it doesn't, it is not added and false is returned.

void rt::TopManager::calcCharts (  const IniFile &    charts,
Vector< TopTourResult > &    store
) 
 

Calculates the charts store from the results files.

The store is cleared first. When done, sorts the store so that it is ordered after points, highest first.

void rt::TopManager::readCharts (  const IniFile &    charts,
Vector< TopTourResult > &    store
) 
 

Reads the charts ini file into the given store, which is cleared first.

This method is not intended for usage in TopManager itself (which should always calculate the results from the results files, not from the charts), but for usage in HTML (or other readable formats) generators.


The documentation for this class was generated from the following files:
This is the RoboTour API documentation version 0.1 • Copyright (C) by Florian Fischer