44 #ifndef ILQGAMES_DYNAMICS_MULTI_PLAYER_INTEGRABLE_SYSTEM_H 45 #define ILQGAMES_DYNAMICS_MULTI_PLAYER_INTEGRABLE_SYSTEM_H 47 #include <ilqgames/utils/operating_point.h> 48 #include <ilqgames/utils/strategy.h> 49 #include <ilqgames/utils/types.h> 62 virtual VectorXf Integrate(Time t0, Time time_interval,
const VectorXf& x0,
63 const std::vector<VectorXf>& us)
const = 0;
64 VectorXf Integrate(Time t0, Time t,
const VectorXf& x0,
66 const std::vector<Strategy>& strategies)
const;
67 VectorXf Integrate(
size_t initial_timestep,
size_t final_timestep,
69 const std::vector<Strategy>& strategies)
const;
70 VectorXf IntegrateToNextTimeStep(
71 Time t0,
const VectorXf& x0,
const OperatingPoint& operating_point,
72 const std::vector<Strategy>& strategies)
const;
73 VectorXf IntegrateFromPriorTimeStep(
75 const std::vector<Strategy>& strategies)
const;
78 VectorXf Integrate(Time t0, Time time_interval,
79 const Eigen::Ref<VectorXf>& x0,
80 const std::vector<Eigen::Ref<VectorXf>>& us)
const;
85 virtual bool TreatAsLinear()
const {
return false; }
90 virtual VectorXf Stitch(
const VectorXf& x_ego,
91 const VectorXf& x_others)
const {
97 static void IntegrateUsingEuler() { integrate_using_euler_ =
true; }
98 static void IntegrateUsingRK4() { integrate_using_euler_ =
false; }
99 static bool IntegrationUsesEuler() {
return integrate_using_euler_; }
102 Dimension XDim()
const {
return xdim_; }
103 Dimension TotalUDim()
const {
105 for (PlayerIndex ii = 0; ii < NumPlayers(); ii++) total += UDim(ii);
108 virtual Dimension UDim(PlayerIndex player_idx)
const = 0;
109 virtual PlayerIndex NumPlayers()
const = 0;
110 virtual std::vector<Dimension> PositionDimensions()
const = 0;
113 virtual float DistanceBetween(
const VectorXf& x0,
const VectorXf& x1)
const {
114 return (x0 - x1).squaredNorm();
121 const Dimension xdim_;
126 static bool integrate_using_euler_;