20 #ifndef _ALEAGENTHOST_H_
21 #define _ALEAGENTHOST_H_
24 #include "ArgumentParser.h"
25 #include "ClientConnection.h"
26 #include "ClientPool.h"
27 #include "MissionInitSpec.h"
28 #include "MissionRecord.h"
29 #include "MissionSpec.h"
30 #include "StringServer.h"
31 #include "VideoServer.h"
32 #include "WorldState.h"
33 #include "AgentHost.h"
36 #include <boost/thread.hpp>
57 void setSeed(
int seed) { this->seed = seed; }
102 friend std::ostream& operator<<(std::ostream& os,
const ALEAgentHost& ah);
108 void onReward(boost::posix_time::ptime ts,
float reward);
116 boost::shared_ptr<ALEInterface> ale_interface;
117 std::unique_ptr<VideoFrameWriter> video_frame_writer;
119 mutable boost::mutex world_state_mutex;
121 boost::shared_ptr<MissionRecord> current_mission_record;
124 int requested_height;
125 std::ofstream commands_stream;
126 std::ofstream reward_stream;
An ALE agent host mediates between the researcher's code (the agent) and the ALE (the target environm...
Definition: ALEAgentHost.h:47
void setRewardsPolicy(AgentHost::RewardsPolicy rewardsPolicy)
Specifies how you want to deal with multiple rewards.
~ALEAgentHost()
Destructor.
void sendCommand(std::string command)
Sends a command to the game client.
ALEAgentHost()
Creates an agent host with default settings.
void startMission(const MissionSpec &mission, const MissionRecordSpec &mission_record)
Starts a mission running, in the simple case where there is only one agent running on the local machi...
WorldState peekWorldState() const
Gets the latest world state received from the game.
void setSeed(int seed)
Set the random seed used to seed the ALE.
Definition: ALEAgentHost.h:57
WorldState getWorldState()
Gets the latest world state received from the game.
void setVideoPolicy(AgentHost::VideoPolicy videoPolicy)
Specifies how you want to deal with multiple video frames.
std::string getRecordingTemporaryDirectory() const
Gets the temporary directory being used for the mission record, if recording is taking place.
void startMission(const MissionSpec &mission, const ClientPool &client_pool, const MissionRecordSpec &mission_record, int role, std::string unique_experiment_id)
Starts a mission running.
void setObservationsPolicy(AgentHost::ObservationsPolicy observationsPolicy)
Specifies how you want to deal with multiple observations.
RewardsPolicy
Specifies what to do when there are more rewards being received than can be processed.
Definition: AgentHost.h:87
VideoPolicy
Specifies what to do when there are more video frames being received than can be processed.
Definition: AgentHost.h:81
ObservationsPolicy
Specifies what to do when there are more observations being received than can be processed.
Definition: AgentHost.h:94
A general purpose command-line argument parser.
Definition: ArgumentParser.h:34
Specifies a mission to be run.
Definition: MissionSpec.h:37
A pool of expected network locations of Mod clients.
Definition: ClientPool.h:34
Specifies the type of data that should be recorded from the mission.
Definition: MissionRecordSpec.h:42
A string with an attached timestamp saying when it was collected.
Definition: TimestampedString.h:36
An image with an attached timestamp saying when it was collected.
Definition: TimestampedVideoFrame.h:36
Represents the state of the game world at a moment in time.
Definition: WorldState.h:35