22 std::map<std::string, Agent *> agents,
24 : MLModelRunner(Kind::ONNX, Ctx), env(env), agents(agents) {}
26void ONNXModelRunner::addAgent(
Agent *agent, std::string name) {
31 std::cerr <<
"ERROR: Agent with the name " << name
32 <<
" already exists. Please give a different name!\n";
42 action = current_agent->computeAction(obs);
45 std::cout <<
"Done🎉\n";
51void *ONNXModelRunner::evaluateUntyped() {
ONNXModelRunner class supporting communication via ONNX C++ Runtime.
Agent is a wrapper around the ONNXModel class, interfaces with the Environment class to support ML/RL...
bool checkDone()
CheckDone returns true if the termination condition is met at the end of the episode.
virtual Observation & step(Action action)=0
Step function takes an action as input and returns the observation corresponding to the next state.
virtual Observation & reset()=0
Reset function returns the initial observation.
std::string getNextAgent()
GetNextAgent returns the name/ID of the next agent to interact with.
llvm::SmallVector< float, 300 > Observation
std::map< std::string, Agent * > agents
ONNXModelRunner(Environment *env, std::map< std::string, Agent * > &&agents)