1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/* *****************************************************************************
* The method lives() is based on Xitari's code, from Google Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *****************************************************************************
* A.L.E (Arcade Learning Environment)
* Copyright (c) 2009-2013 by Yavar Naddaf, Joel Veness, Marc G. Bellemare and
* the Reinforcement Learning and Artificial Intelligence Laboratory
* Released under the GNU General Public License; see License.txt for details.
*
* Based on: Stella -- "An Atari 2600 VCS Emulator"
* Copyright (c) 1995-2007 by Bradford W. Mott and the Stella team
*
* *****************************************************************************
*/
#ifndef __QBERT_HPP__
#define __QBERT_HPP__
#include "../RomSettings.hpp"
namespace ale {
/* RL wrapper for QBert */
class QBertSettings : public RomSettings {
public:
QBertSettings();
// reset
void reset() override;
// is end of game
bool isTerminal() const override;
// get the most recently observed reward
reward_t getReward() const override;
// the rom-name
const char* rom() const override { return "qbert"; }
// create a new instance of the rom
RomSettings* clone() const override;
// is an action part of the minimal set?
bool isMinimal(const Action& a) const override;
// process the latest information from ALE
void step(const System& system) override;
// saves the state of the rom settings
void saveState(Serializer& ser) override;
// loads the state of the rom settings
void loadState(Deserializer& ser) override;
int lives() override { return isTerminal() ? 0 : m_lives; }
// returns a list of difficulties that the game can be played in
// in this game, there are 2 available difficulties
DifficultyVect getAvailableDifficulties() override;
private:
bool m_terminal;
reward_t m_reward;
reward_t m_score;
int m_last_lives;
int m_lives;
};
} // namespace ale
#endif // __QBERT_HPP__