![]() |
IAtari
Genetic algorithm generating AI capable to play Atari2600 games.
|
A set of useful method and class. More...
Classes | |
class | Random |
RNG based on Xoroshiro128+. More... | |
class | ThreadGroup |
An implementation of Thread group. More... | |
class | ThreadPool |
An implementation of Thread pool. More... | |
Functions | |
static std::uint64_t | splitmix64 (std::uint64_t z) |
void | atomic_add (std::atomic< T > &f, T d) |
Perform an atomic addition. More... | |
T | rotl (const T x, const int k) |
Rotate bytes to the left. More... | |
bool | is7bit (int c) |
Check if a value is written on 7 bits. More... | |
size_t | ceilMultiple (size_t a, size_t b) |
Calculate the closest value from a such that this new value is a multiple of b. More... | |
int | secam_to_range_index (int i) |
Transform a secam color value to a power of two. More... | |
void | secam210x160_to_42x32 (const std::vector< unsigned char > &screen, std::vector< unsigned char > &screen42x32) |
Reduce the screen from 210x160 to 42x32. More... | |
void | init_ALE () |
Initialize the emulator from the config file. More... | |
vector< vector< string > > | read_Config () |
Store values extracted from the config file to a vector. More... | |
A set of useful method and class.
Utils::atomic_add | ( | std::atomic< T > & | f, |
T | d | ||
) |
Perform an atomic addition.
[in,out] | f | Original atomic value |
d | Value added to the atomic value |
size_t Utils::ceilMultiple | ( | size_t | a, |
size_t | b | ||
) |
Calculate the closest value from a such that this new value is a multiple of b.
a | The divided |
b | The divisor |
Utils::init_ALE | ( | ) |
Initialize the emulator from the config file.
The properties set are repeat_action_probability, display_screen, sound, ROM and colourPalette
|
inline |
Check if a value is written on 7 bits.
c | The checked value |
Utils::read_Config | ( | ) |
Store values extracted from the config file to a vector.
The config file is config.config. This file have to be flawlessly written or the algorithm will crash.
Utils::rotl | ( | const T | x, |
const int | k | ||
) |
Rotate bytes to the left.
x | Value to be rotated |
k | Number of bits to shift |
Utils::secam210x160_to_42x32 | ( | const std::vector< unsigned char > & | screen, |
std::vector< unsigned char > & | screen42x32 | ||
) |
Reduce the screen from 210x160 to 42x32.
[in] | screen | The input screen (pointer vector) |
[out] | screen42x32 | The output screen (pointer vector) |
|
inline |
Transform a secam color value to a power of two.
i | The color value we want to transform |
|
static |