45 #ifndef ILQGAMES_UTILS_RELATIVE_TIME_TRACKER_H 46 #define ILQGAMES_UTILS_RELATIVE_TIME_TRACKER_H 48 #include <ilqgames/utils/types.h> 50 #include <glog/logging.h> 59 static void ResetInitialTime(Time t0) { initial_time_ = t0; };
60 static Time InitialTime() {
return initial_time_; }
63 static Time RelativeTime(
size_t kk) {
64 return static_cast<Time
>(kk) * time::kTimeStep;
66 static Time AbsoluteTime(
size_t kk) {
67 return initial_time_ +
static_cast<Time
>(kk) * time::kTimeStep;
69 static size_t TimeIndex(Time t) {
70 CHECK_GE(t, initial_time_);
71 return static_cast<size_t>((t - initial_time_) / time::kTimeStep);
75 const std::string& Name()
const {
return name_; }
81 const std::string name_;
84 static Time initial_time_;