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

rt Namespace Reference

All classes in the RoboTour main program and the associated programs are inside the namespace rt. More...


Compounds

class  rt::AllInOneManager
 Play a all-in-one tournament. More...

class  rt::Bank
 A code bank. More...

class  rt::Bot
 A robot on the field. More...

class  rt::BotErrorHandler
class  rt::ChartsManager
 Plays a charts or single tournament. More...

class  rt::ConsoleBotPresenter
class  rt::ConsoleFrontend
class  rt::DebugPrinter
class  rt::DefineInputStream::Define
class  rt::DefineInputStream
 An input stream which automatically replaces Defines while reading. More...

class  rt::ErrorHandler
 Handles all kinds of errors. More...

class  rt::ExecSupervisor
 Another interface for supervising simulations. More...

class  rt::ConsoleFrontend::MyTourDisplayer
class  rt::FieldPrinter
class  rt::Frontend
 Manages the option acquisition from and result presentation to the user. More...

class  rt::FrontendPlugin
 A plugin which extends Frontends. More...

class  rt::Globals
 The global variables for the game - also known as the OptionSet (RCO) */. More...

class  rt::HtmlCreator
 Creates HTML results files for top mode competitions. More...

class  rt::InstrAdd
class  rt::InstrAjump
class  rt::InstrBjump
class  rt::InstrBreak
class  rt::InstrComp
class  rt::InstrCreate
class  rt::InstrDie
class  rt::InstrDiv
class  rt::InstrFarscan
class  rt::InstrGcomp
class  rt::InstrInit
class  rt::InstrJump
class  rt::InstrLcomp
class  rt::InstrMax
class  rt::InstrMin
class  rt::InstrMod
class  rt::InstrMove
class  rt::InstrMul
class  rt::InstrNcomp
class  rt::InstrQuit
class  rt::InstrRandom
class  rt::InstrResume
class  rt::InstrRtrans
class  rt::InstrScan
class  rt::InstrSeize
class  rt::InstrSet
class  rt::InstrSleep
class  rt::InstrSub
class  rt::InstrTrans
class  rt::InstrTurn
class  rt::NoBreakSection
 a section of code which should not be abortable by the user. It is protected by a breakHandler which defers the break until the section is finished. (You can also ignore the break completely.). More...

struct  rt::ProfileBankData
class  rt::ProfileLine
class  rt::ProfilePlugin
 The RoboTour profiler. More...

class  rt::ProfileSupervisor
struct  rt::ProgramLoader::LoadReturnType
class  rt::ProgramLoader
 Loads a robot from a certain type of files. More...

class  rt::RatingPlugin
 Rates the simulation result (for the first participating robot) and provides more detailed information than just "win, loss or tie". The robot's success is displayed as a float value. More...

class  rt::RatingSimSupervisor
class  rt::RbiLoader
class  rt::RobLoader
 Loads ROB files. More...

struct  rt::SifSimpleStringArray
class  rt::SimManager
 Manages a tournament. More...

class  rt::SimOptions
 Options for the simulations created by the SimManager. More...

struct  rt::SimSupervisor::GameState
class  rt::Instr
 Implements one instruction in a robot's program. More...

struct  rt::Instr::Op
struct  rt::Program::HeaderField
class  rt::KickbotArgs
class  rt::MkHtmlArgs
class  rt::Program
 One of the players on the field. More...

class  rt::SimSupervisor
 This interface can be implemented if you want to plug into a running simulation. More...

class  rt::Simulation
 Implements one simulation. More...

class  rt::DefineInputStream::StreamInfo
class  rt::DefineInputStream::StringInStream
class  rt::SoundPlugin
class  rt::SoundSimSupervisor
class  rt::SoundTourDisplayer
class  rt::StdBotCreator
 Creates a robot for each Program at the beginning of the Simulation. More...

class  rt::StdVictorySupervisor
 Checks if the Simulation is finished using default rules. More...

class  rt::StreamErrorHandler
class  rt::StreamInterface
class  rt::StreamSimSupervisor
class  rt::StreamTourDisplayer
class  rt::Task
 One task in a robot. More...

class  rt::TopInfo
 Holds special information about a certain robot. More...

class  rt::TopManager
 Manages a top mode tournament. More...

class  rt::TopTourResult
 Extends TourResult to store additional information as required by TopManager. More...

class  rt::TourDisplayer
 Can display the tournament results. More...

class  rt::TourInitInfo
 Information about the tournament which is valid throughout the tournament, and therefore given only one (in TourDisplayer::init()) to the TourDisplayer. More...

class  rt::TourResult
 The tournament results (until now) for a certain Program. More...

class  rt::VisDebugSupervisor
class  rt::VisPlugin
class  rt::VisSupervisor
class  rt::VisTourDisplayer
class  rt::WxFrontend

Typedefs

typedef Map< Bank *, ProfileBankData > ProfileMap
typedef short rint
 The "RoboCom Integer" (rint) is an all-purpose 16-bit signed integer.


Enumerations

enum  RCInstr {
  rcDie = 2, rcTrans = 3, rcMove = 4, rcTurn = 5,
  rcJump = 6, rcSet = 7, rcAdd = 8, rcSub = 9,
  rcBjump = 10, rcComp = 12, rcCreate = 13, rcScan = 14,
  rcNcomp = 15, rcLcomp = 16, rcGcomp = 17, rcRandom = 18,
  rcMin = 19, rcMax = 20, rcRtrans = 21, rcAjump = 22,
  rcSleep = 23, rcInit = 24, rcSeize = 25, rcResume = 26,
  rcBreak = 27, rcQuit = 28, rcMul = 29, rcDiv = 30,
  rcMod = 31, rcFarscan = 32
}
enum  RCParams {
  rcBanks = 1001, rcMobile = 1002, rcInstrSet = 1003, rcActive = 1004,
  rcFields = 1005, rcGeneration = 1006, rcTime = 1007, rcMybots = 1008,
  rcOtherbots = 1009, rcPub = 1010, rcRandNum = 1011, rcInstrPos = 1012,
  rcTasks = 1013, rcId = 1014, rcTimeout = 1015, rcMaxLifetime = 1016,
  rcElimTrigger = 1017, rcMaxVars = 1018, rcMaxTasks = 1019, rcMaxGeneration = 1020,
  rcMaxMybots = 1021, rcAge = 1022
}
enum  FpInterpretePos { fpInterPosBefore, fpInterPosAfter }
 Specifies when the FrontendPlugin should be called to interprete params. More...

enum  TourStatusType { tourAbort = -1, tourComplete = 0, tourContinue = tourComplete }
enum  ProfileMode { profCount, profTime, profFailure }
 Type of Profile that is generated. More...

enum  StreamifMode { sifModeOld, sifModeRT3 }
enum  StreamifDispType {
  sifDispNone = 0, sifDispRunningBankOwner, sifDispGeneration, sifDispNumBanks,
  sifDispRunningBank
}
enum  VerboseMode { verbRemote = -999, verbNone = 0, verbSome = 2, verbNormal = 5 }
enum  SimVar {
  simFields = 0, simPub, simTime, simMaxGeneration,
  simMaxVars, simMaxTasks, simMaxMybots, simTimeout,
  simElimTrigger, simMaxLifetime, simVarLength
}
 Simulation variable array indices. More...

enum  HeaderType { headerInternal, headerSecret, headerPublished }
 Header field types.

enum  ProgramVar { progMybots = 0, progOtherbots, progId, progVarLength }
 Program variable array indices. More...

enum  BotVar {
  botActive = 0, botNumBanks, botGeneration, botPosX,
  botPosY, botInstrSet, botMobile, botNumTasks,
  botVarLength
}
 Bot variable array indices. More...

enum  TimingMode { timingNumExec = 0, timingNumWaited = 1 }
 Instruction timing modes. More...

enum  TaskVar {
  taskCurBank = 0, taskCurInstr, taskDir, taskNumCycles,
  taskCyclesDone, taskTimingMode, taskVarLength
}
 Task variable array indices. More...

enum  Direction { dirRight = 0, dirUp = 1, dirLeft = 2, dirDown = 3 }
 Directions.

enum  TurnType { turnLeft = 1, turnRight = 3 }
 Turn directions.

enum  OpType {
  opTypeNumber, opTypeTask, opTypeActive, opTypeNamedVar,
  opTypeUnnamedVar, opTypeArray, opTypeProgram, opTypeGlobal,
  opTypeFields, opTypeAge, opTypeLabel, opTypeAbsLabel,
  opTypeRandom = 99
}
 Operand types (sources). More...

enum  ExecReturnType {
  execSleeps = 1, execOK = 0, failElim = -1, failData = -2,
  failDiv0 = -3, failBank = -4, failInstrSet = -5, failMobile = -6,
  failDie = -7, failParam = -8, failUnemploy = -9, failInstrDur = -10,
  failAge = -11, failQuit = -12, failLast = failQuit
}
 Instr->exec() return types (error codes). More...

enum  SimSuperPosition {
  supPosFront = -100, supPosDontCare = 0, supPosBack = 100, supPosBotCreator = 999,
  supPosBotPresenter = 1000
}
 Preferred position in the supervisor list. More...

enum  GameEventType { gameAbort = -1, gameNothing = 0, gameTie, gameFinished }
 Type of current game event. More...

enum  RobLoadConstants { rlMaxRecurse = 10 }
 Constants. More...

enum  RobLoadReturnType {
  rlOK = 0, rlFailNoBanks = 1, rlFailUnknownCommand = 2, rlFailUnknownParam = 3,
  rlFailWrongParCount = 4, rlFailExpectComma = 5, rlFailExpectBank = 6, rlFailUndefinedLabel = 7,
  rlFailRedefinedLabel = 8, rlFailNoFile = 9, rlFailNoMemory = 10, rlFailRC3Required = 11,
  rlFailMuTaRequired = 12, rlFailTooManyBanks = 13, rlFailTooManyInstrs = 14, rlFailDefines = 15,
  rlFailWrongDefinePar = 16, rlFailTooManyDefinePar = 17, rlFailExpectAnd = 18, rlFailExpectBOpen = 19,
  rlFailExpectBClose = 20, rlFailExpectOpen = 21, rlFailExpectClose = 22, rlFailExpectQuestionMark = 23,
  rlFailRecurse = 24, rlFailUndefinedDefine = 25, rlFailRedefinedDefine = 26, rlFailInvalidIdentifier = 27
}
 Load fail codes. More...

enum  RbiLoadReturnType {
  rbOK = 0, rbFailNoBanks = 1, rbFailUnknownCommand = 2, rbFailUnknownParam = 3,
  rbFailWrongParCount = 4, rbFailNoFile = 5, rbFailNoMemory = 6, rbFailRC3Required = 7,
  rbFailMuTaRequired = 8, rbFailTooManyBanks = 9, rbFailTooManyInstrs = 10, rbFailEndOfFile = 11,
  rbFailUndefined = 12
}
 Load fail codes. More...

enum  GenLoadFailType { genFailLanguageVersion = 0 }
enum  { WaitInfinite = -1 }

Functions

KickbotArgs parseArgs (const lrt::Array< lrt::String > &args)
void printHelp ()
lrt::String getInfoFileName (const lrt::File &compFolder, const lrt::String &botname)
String resizeString (const String &str, int length)
void initPackage ()
lrt::String findSomething (const lrt::String &xfolder, const lrt::String &file)
lrt::String findOptionSet (const lrt::String &file)
lrt::String findHelpFile (const lrt::String &file)
bool HaveVisFrame ()
void PostAndWait (wxEvent &evt, int maxWait)

Variables

const char * extraDataDir = ""
const char * simVarNames []
const char * progVarNames []
const char * botVarNames []
const char * taskVarNames []
const char * failMsg []
 Bot::exec() fail codes. More...

const char * robLoadFailMsg []
 RobLoader::load() fail codes. More...

const char * rbiLoadFailMsg []
 RbiLoader::load() fail codes. More...

const char * genLoadFailMsg []
 Generic ProgramLoader::loadXxx() failure codes. More...

const char * version = "3.10"
 version string for use by the program. must be parsable as a floating-point number.

const char * userVersion = "3.10-lite (No RBI support)"
 same as version, but formatted for the user.

const char * aboutText
 copyright and release info. More...

const int languageVersion = 300
const rint MAX_RINT = 32767
const rint MIN_RINT = -32768


Detailed Description

All classes in the RoboTour main program and the associated programs are inside the namespace rt.

Enumeration Type Documentation

enum rt::BotVar
 

Bot variable array indices.

Enumeration values:
botActive  ACTIVE.
botNumBanks  $NUMBANKS.
botGeneration  $GENERATION.
botPosX  x position on the field.
botPosY  y position on the field.
botInstrSet  $INSTRSET.
botMobile  $MOBILE.
botNumTasks  $TASKS.
botVarLength  bot variable count.

enum rt::ExecReturnType
 

Instr->exec() return types (error codes).

Enumeration values:
execSleeps  returned by Task::exec() : Task sleeps, do another task.
execOK  Instruction executed normally.
failElim  Elinination Trigger released.
failData  Data Hunger (Bank 1 empty).
failDiv0  Division by zero.
failBank  Source bank not present in TRANS.
failInstrSet  Higher Instruction Set required.
failMobile  Mobility required.
failDie  DIE executed.
failParam  invalid parameter (e.g. Create x,-1,x).
failUnemploy  No more tasks left in a robot.
failInstrDur  Instruction duration too high.
failAge  Maximum Lifetime exceeded.
failQuit  Quit executed, still enough tasks (This will not destroy the bot!).

enum rt::FpInterpretePos
 

Specifies when the FrontendPlugin should be called to interprete params.

Possible positions are before or after the Frontend itself interpretes them.

Enumeration values:
fpInterPosBefore  Call the plugin before the Frontend itself interpretes the params.

This is the required position for plugins which need to 'use up' params which are not understood by the Frontend itself.

fpInterPosAfter  Call the plugin after the Frontend itself has interpreted the params.

This is the required position for plugins which need to access the data the frontend itself creates from the params.

enum rt::GameEventType
 

Type of current game event.

Enumeration values:
gameAbort  User abort.
gameNothing  No special event, continue game normally.
gameTie  Game is tied (e.g. by a timeout).
gameFinished  Game is finished, one of the programs won.

enum rt::GenLoadFailType
 

Enumeration values:
genFailLanguageVersion  unsupported language version.

enum rt::OpType
 

Operand types (sources).

Enumeration values:
opTypeNumber  a rint literal (269).
opTypeTask  task variable ($INSTRPOS).
opTypeActive  only #ACTIVE.
opTypeNamedVar  a named robot variable or constant ($BANKS...).
opTypeUnnamedVar  the standard integers (#1..#20 (or more?)).
opTypeArray  array access to the standard integers (##1).
opTypeProgram  a program variable ($ID...).
opTypeGlobal  a simulation variable (PUB...).
opTypeFields  only $FIELDS (because it's direction dependent).
opTypeAge  only $AGE (because it has to be calculated).
opTypeLabel  a label-jump-call (@begin).
opTypeAbsLabel  an absolute label call (@begin).
opTypeRandom  a random number ($RANDNUM).

enum rt::ProfileMode
 

Type of Profile that is generated.

Enumeration values:
profCount  count number of instruction executions.
profTime  count time spent for instructions.
profFailure  measure permilleage of failed instructions.

enum rt::ProgramVar
 

Program variable array indices.

Enumeration values:
progMybots  $MYBOTS.
progOtherbots  $OTHERBOTS.
progId  $ID.
progVarLength  prog variable count (array length).

enum rt::RbiLoadReturnType
 

Load fail codes.

Enumeration values:
rbOK  everything ok.
rbFailNoBanks  no banks defined in bot.
rbFailUnknownCommand  unknown command (e.g. AOGZ).
rbFailUnknownParam  unknown parameter (e.g. $g02).
rbFailWrongParCount  wrong number of parameters for instruction (e.g. MOVE 5).
rbFailNoFile  File not found (or not accessible).
rbFailNoMemory  Insufficient memory.
rbFailRC3Required  RC3 instruction found, but disabled (e.g. MUL).
rbFailMuTaRequired  MuTa instruction found, but disabled (e.g. INIT).
rbFailTooManyBanks  Too many banks in bot.
rbFailTooManyInstrs  Too many instructions in bank.
rbFailEndOfFile  End of file unexpected.
rbFailUndefined  Other error.

enum rt::RobLoadConstants
 

Constants.

Enumeration values:
rlMaxRecurse  Maximum Define Recursion Depth.

enum rt::RobLoadReturnType
 

Load fail codes.

Enumeration values:
rlOK  everything ok.
rlFailNoBanks  no banks defined in bot.
rlFailUnknownCommand  unknown command (e.g. AOGZ).
rlFailUnknownParam  unknown parameter (e.g. $g02).
rlFailWrongParCount  wrong number of parameters for instruction (e.g. MOVE 5).
rlFailExpectComma  Comma expected.
rlFailExpectBank  Bank expected.
rlFailUndefinedLabel  Call of undefined label.
rlFailRedefinedLabel  Label declared twice.
rlFailNoFile  File not found (or not accessible).
rlFailNoMemory  Insufficient memory.
rlFailRC3Required  RC3 instruction found, but disabled (e.g. MUL).
rlFailMuTaRequired  MuTa instruction found, but disabled (e.g. INIT).
rlFailTooManyBanks  Too many banks in bot.
rlFailTooManyInstrs  Too many instructions in bank.
rlFailDefines  Generic Define error.
rlFailWrongDefinePar  No such define parameter.
rlFailTooManyDefinePar  Too many define parameters.
rlFailExpectAnd  Expect "&".
rlFailExpectBOpen  Expect "{".
rlFailExpectBClose  Expect "}".
rlFailExpectOpen  Expect "(".
rlFailExpectClose  Expect ")".
rlFailExpectQuestionMark  Expect "?".
rlFailRecurse  Too many recursion levels.
rlFailUndefinedDefine  Undeclared define.
rlFailRedefinedDefine  Define declared twice.
rlFailInvalidIdentifier  Invalid character in identifier (e.g. '<').

enum rt::SimSuperPosition
 

Preferred position in the supervisor list.

Enumeration values:
supPosFront  In the first part of the list.
supPosDontCare  Irrelevant for this supervisor.
supPosBack  In the last part of the list.
supPosBotCreator  Special value for supervisors which create Bots in initSim().
supPosBotPresenter  Special value for sup's which present the loaded bots in initSim().

enum rt::SimVar
 

Simulation variable array indices.

Enumeration values:
simFields  $FIELDS.
simPub  PUB.
simTime  $TIME.
simMaxGeneration  $MaxGeneration.
simMaxVars  $MaxVars.
simMaxTasks  $MaxTasks.
simMaxMybots  $MaxMybots.
simTimeout  $Timeout.
simElimTrigger  $ElimTrigger.
simMaxLifetime  $MaxLifetime.
simVarLength  sim variable count (array length).

enum rt::TaskVar
 

Task variable array indices.

Enumeration values:
taskCurBank  current executing bank (RUNBANK).
taskCurInstr  $INSTRPOS.
taskDir  current heading (direction).
taskNumCycles  number of cycles the current instruction takes to execute.
taskCyclesDone  number of cycles already done for the current instruction.
taskTimingMode  current timing mode (see TimingMode).
taskVarLength  task variable count.

enum rt::TimingMode
 

Instruction timing modes.

Enumeration values:
timingNumExec  Number of actually executed cycles.
timingNumWaited  Number of cycles waited (only used for SLEEP).

enum rt::VerboseMode
 

Enumeration values:
verbRemote  Remote control.
verbNone  Silence.
verbSome  Some output.
verbNormal  Quite a lot of output.


Variable Documentation

const char * rt::aboutText
 

Initial value:

 "Copyright (C) 2000-2004 Florian Fischer and Martin Trautmann\n"




                                                "NOTE that this version of RoboTour lacks certain features, such\n"
                                                "as support for binary robot files (RBI).\n"
                                                "The full version may be downloaded from the RoboCom homepage.\n"

                                                "The RoboCom Homepage: http://www.cyty.com/robocom/"
copyright and release info.

const char * rt::botVarNames
 

Initial value:

 {
        "#Active",
        "$Banks",
        "$Generation",
        "!PosX",
        "!PosY",
        "$InstrSet",
        "$Mobile",
        "$Tasks"
}

const char * rt::failMsg
 

Initial value:

 {
        "",
        "Elemination Trigger released",
        "Data Hunger",
        "Division by zero",
        "Invalid source or target bank",
        "Higher instruction set required",
        "Mobility required",
        "DIE executed",
        "Invalid parameter",
        "Unemployment: no tasks left",
        "Instruction duration too high",
        "Maximum Lifetime exceeded",
        "Quit executed"
}
Bot::exec() fail codes.

Leave first one empty.

See also:
ExecReturnType

const char * rt::genLoadFailMsg
 

Initial value:

 {
        "Unsupported RoboCom Language version"
}
Generic ProgramLoader::loadXxx() failure codes.

See also:
GenLoadFailType

const char * rt::progVarNames
 

Initial value:

 {
        "$MyBots",
        "$OtherBots",
        "$ID"
}

const char * rt::rbiLoadFailMsg
 

Initial value:

 {
        "",
        "No banks defined in bot",
        "Unknown command",
        "Unknown parameter",
        "Wrong number of parameters",
        "File not found",
        "Not enough memory",
        "RC3 instructions required",
        "Multitasking required",
        "Too many banks in bot",
        "Too many instructions in bank",
        "Unexpected end of file",
        "Unknown error"
}
RbiLoader::load() fail codes.

Leave first one empty.

See also:
RbiLoadReturnType

const char * rt::robLoadFailMsg
 

Initial value:

 {
        "",
        "No banks defined in bot",
        "Unknown command",
        "Unknown parameter",
        "Wrong number of parameters",
        "Comma expected",
        "Bank expected",
        "Undefined label",
        "Label declared twice",
        "File not found",
        "Not enough memory",
        "RC3 instructions required",
        "Multitasking required",
        "Too many banks in bot",
        "Too many instructions in bank",
        "Generic Define Error",
        "Undeclared Define parameter",
        "Too many Define parameters",
        "Ampersand '&' expected",
        "Opening brace '{' expected",
        "Closing brace '}' expected",
        "Opening bracket '(' expected",
        "Closing bracket ')' expected", 
        "Question mark '?' expected",
        "Too many recursion levels",
        "Undeclared define",
        "Define declared twice",
        "Invalid character in identifier"
}
RobLoader::load() fail codes.

Leave first one empty.

See also:
RobLoadReturnType

const char * rt::simVarNames
 

Initial value:

 {
        "$Fields",
        "#Pub",
        "$Time",
        "$MaxGeneration",
        "$MaxVars",
        "$MaxTasks",
        "$MaxMybots",
        "$Timeout",
        "$ElimTrigger",
        "$MaxLifetime"
}

const char * rt::taskVarNames
 

Initial value:

 {
        "!RunBank",
        "$InstrPos",
        "!Dir",
        "!NumCyclesReq",
        "!NumCyclesDone",
        "!TimingMode"
}


This is the RoboTour API documentation version 0.1 • Copyright (C) by Florian Fischer