Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove conditional_agent_states and conditional_agent_attributes from InitializeRequest in C++ #124

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions invertedai_cpp/examples/initialize_body.json
Original file line number Diff line number Diff line change
@@ -7,7 +7,5 @@
"get_birdview": false,
"get_infractions": false,
"random_seed": null,
"location_of_interest": null,
"conditional_agent_states": null,
"conditional_agent_attributes": null
"location_of_interest": null
}
31 changes: 0 additions & 31 deletions invertedai_cpp/invertedai/initialize_request.cc
Original file line number Diff line number Diff line change
@@ -11,18 +11,6 @@ InitializeRequest::InitializeRequest(const std::string &body_str) {
this->body_json_["num_agents_to_spawn"].is_number_integer()
? this->body_json_["num_agents_to_spawn"].get<int>()
: 0;
this->conditional_agent_states_.clear();
for (const auto &element : this->body_json_["conditional_agent_states"]) {
AgentState agent_state = {element[0], element[1], element[2], element[3]};
this->conditional_agent_states_.push_back(agent_state);
}

this->conditional_agent_attributes_.clear();
for (const auto &element : this->body_json_["conditional_agent_attributes"]) {
AgentAttributes agent_attribute = {element[0], element[1], element[2]};
this->conditional_agent_attributes_.push_back(agent_attribute);
}

this->states_history_.clear();
for (const auto &elements : this->body_json_["states_history"]) {
std::vector<AgentState> agent_states;
@@ -135,15 +123,6 @@ std::vector<std::vector<AgentState>> InitializeRequest::states_history() const {
return this->states_history_;
}

std::vector<AgentState> InitializeRequest::conditional_agent_states() const {
return this->conditional_agent_states_;
}

std::vector<AgentAttributes>
InitializeRequest::conditional_agent_attributes() const {
return this->conditional_agent_attributes_;
}

std::vector<AgentAttributes> InitializeRequest::agent_attributes() const {
return this->agent_attributes_;
}
@@ -180,16 +159,6 @@ void InitializeRequest::set_num_agents_to_spawn(int num_agents_to_spawn) {
this->num_agents_to_spawn_ = num_agents_to_spawn;
}

void InitializeRequest::set_conditional_agent_states(
const std::vector<AgentState> &conditional_agent_states) {
this->conditional_agent_states_ = conditional_agent_states;
}

void InitializeRequest::set_conditional_agent_attributes(
const std::vector<AgentAttributes> &conditional_agent_attributes) {
this->conditional_agent_attributes_ = conditional_agent_attributes;
}

void InitializeRequest::set_states_history(
const std::vector<std::vector<AgentState>> &states_history) {
this->states_history_ = states_history;
22 changes: 0 additions & 22 deletions invertedai_cpp/invertedai/initialize_request.h
Original file line number Diff line number Diff line change
@@ -15,8 +15,6 @@ class InitializeRequest {
private:
std::string location_;
int num_agents_to_spawn_;
std::vector<AgentState> conditional_agent_states_;
std::vector<AgentAttributes> conditional_agent_attributes_;
std::vector<std::vector<AgentState>> states_history_;
std::vector<AgentAttributes> agent_attributes_;
std::vector<std::vector<TrafficLightState>> traffic_light_state_history_;
@@ -48,15 +46,6 @@ class InitializeRequest {
/**
* Get history of agent states.
*/
std::vector<AgentState> conditional_agent_states() const;
/**
* Get conditional agent states.
*/
std::vector<AgentAttributes> conditional_agent_attributes() const;
/**
* Get conditional agent attributes.
*/

std::vector<std::vector<AgentState>> states_history() const;
/**
* Get static attributes for all agents.
@@ -106,17 +95,6 @@ class InitializeRequest {
* inner over time, in chronological order. For best results, provide at least
* 10 historical states for each agent.
*/
void set_conditional_agent_states(
const std::vector<AgentState> &conditional_agent_states);
/**
* Optional conditional agent states when `agent_count` is passed. When
* passed, `agent_count` includes the number of conditional agents passed.
*/
void set_conditional_agent_attributes(
const std::vector<AgentAttributes> &conditional_agent_attributes);
/**
* Optional agent attributes when `conditional_agent_states` is passed.
*/
void set_states_history(
const std::vector<std::vector<AgentState>> &states_history);
/**