Project Malmo  0.37.0
MissionInitXML.h
1 // --------------------------------------------------------------------------------------------------
2 // Copyright (c) 2016 Microsoft Corporation
3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
5 // associated documentation files (the "Software"), to deal in the Software without restriction,
6 // including without limitation the rights to use, copy, modify, merge, publish, distribute,
7 // sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
8 // furnished to do so, subject to the following conditions:
9 //
10 // The above copyright notice and this permission notice shall be included in all copies or
11 // substantial portions of the Software.
12 //
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
14 // NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
16 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18 // --------------------------------------------------------------------------------------------------
19 
20 #ifndef _MISSIONINITXML_H_
21 #define _MISSIONINITXML_H_
22 
23 // STL:
24 #include <string>
25 
26 // Boost:
27 #include <boost/property_tree/ptree.hpp>
28 
29 namespace malmo {
30 
32  public:
34  MissionInitXML(std::string xml_text);
35 
36  void parse(std::string xml_text);
37 
38  std::string toXml() const;
39 
40  struct MinecraftServer {
41 
42  boost::optional<std::string> connection_address;
43  boost::optional<int> connection_port;
44  };
45 
47 
49  client_mission_control_port = 0;
50  client_commands_port = 0;
51  agent_mission_control_port = 0;
52  agent_video_port = agent_depth_port = agent_lumunance_port = 0;
53  agent_observations_port = agent_rewards_port = 0;
54  agent_colour_map_port = 0;
55  }
56 
57  std::string client_ip_address;
58  int client_mission_control_port;
59  int client_commands_port;
60  std::string agent_ip_address;
61  int agent_mission_control_port;
62  int agent_video_port;
63  int agent_depth_port;
64  int agent_lumunance_port;
65  int agent_observations_port;
66  int agent_rewards_port;
67  int agent_colour_map_port;
68  };
69 
70  friend class MissionInitSpec;
71 
72  private:
73  std::string schema_version;
74  std::string platform_version;
75 
76  boost::property_tree::ptree mission;
77 
78  std::string experiment_uid;
79  int client_role;
80 
81  MinecraftServer minecraft_server;
82  ClientAgentConnection client_agent_connection;
83  };
84 }
85 #endif
Definition: MissionInitXML.h:31
Definition: MissionInitXML.h:46
Definition: MissionInitXML.h:40