agent-tk 0.4.0

`agent-tk` (`agent toolkit/tasks-knowledge`) is a crate for the development of autonomous agents using Rust, with an emphasis on tasks and knowledge based agents. This project is part of the [auKsys](http://auksys.org) project.
Documentation
//! Support for executing goals.

use crate::{definitions, Result};

/// Convert a goal to a TST
pub struct ToTst {}

impl ToTst
{
  /// Convert a goal to a TST
  pub fn convert(goal: &definitions::goal::Goal) -> Result<definitions::tst::Node>
  {
    let mut builder = definitions::tst::Seq::build(Some(definitions::tst::CommonParameters {
      node_uuid: goal.uuid,
      ..Default::default()
    }));

    for (_, v_goal) in goal.visit.iter()
    {
      builder = builder.add(
        definitions::tst::MoveToParameters {
          waypoint: definitions::tst::GeoPoint {
            longitude: v_goal.position.longitude,
            latitude: v_goal.position.latitude,
            ..Default::default()
          },
          ..Default::default()
        },
        None,
      );
    }
    Ok(builder.into())
  }
}