Given a log on the form (start1, duration1), . More...
#include <LinkScheduleEstimator.h>
Classes | |
| struct | LogEntry |
Public Types | |
| typedef std::vector< LogEntry > | Log |
Public Member Functions | |
| LinkScheduleEstimator () | |
Static Public Member Functions | |
| static Log * | find_schedule (Log *log) |
Private Member Functions | |
| unsigned int | entry_dist (Log &a, unsigned int a_index, unsigned int a_offset, Log &b, unsigned int b_index, unsigned int b_offset, unsigned int warping_window) |
| unsigned int | log_dist_r (Log &a, unsigned int a_index, unsigned int a_offset, Log &b, unsigned int b_index, unsigned int b_offset, unsigned int warping_window) |
| unsigned int | log_dist (Log &a, unsigned int a_offset, Log &b, unsigned int b_offset, unsigned int warping_window, int print_table) |
| unsigned int | autocorrelation (Log &log, unsigned int phase, int print_table) |
| void | print_log (Log &log, int relative_dates) |
| Log * | generate_samples (Log &schedule, unsigned int log_size, unsigned int start_jitter, double duration_jitter) |
| unsigned int | estimate_period (Log &log) |
| unsigned int | seek_to_before_date (Log &log, unsigned int date) |
| return the index of the closest log entry at or before the given date. | |
| unsigned int | closest_entry_to_date (Log &log, unsigned int date) |
| return the index of the closest log entry to the given date | |
| Log * | clone_subsequence (Log &log, unsigned int start, unsigned int len) |
| unsigned int | badness_of_match (Log &pattern, Log &log, unsigned int warping_window, unsigned int period) |
| Log * | extract_schedule (Log &log, unsigned int period_estimate) |
| unsigned int | refine_period (Log &log, unsigned int period_estimate) |
| Log * | find_schedule (Log &log) |
| This is the function to be called from the outside. | |
Given a log on the form (start1, duration1), .
.. ,(startN, durationN), the LinkScheduleEstimator algorithm figures out a periodic schedule that this log conforms to.
The schedule computed can then be used to predict future link-up events, and to inform far-away nodes about the future predicted availability of the link in question.
Usage: Log* find_schedule(Log* log);
Returns the best schedule for the given log. If there's no discernible periodicity in the log, the return value will be NULL.
Definition at line 46 of file LinkScheduleEstimator.h.
| typedef std::vector<LogEntry> dtn::LinkScheduleEstimator::Log |
Definition at line 53 of file LinkScheduleEstimator.h.
| dtn::LinkScheduleEstimator::LinkScheduleEstimator | ( | ) |
Definition at line 32 of file LinkScheduleEstimator.cc.
| unsigned int dtn::LinkScheduleEstimator::autocorrelation | ( | Log & | log, | |
| unsigned int | phase, | |||
| int | print_table | |||
| ) | [private] |
Definition at line 171 of file LinkScheduleEstimator.cc.
References log_dist(), and WARPING_WINDOW.
Referenced by estimate_period().
| unsigned int dtn::LinkScheduleEstimator::badness_of_match | ( | Log & | pattern, | |
| Log & | log, | |||
| unsigned int | warping_window, | |||
| unsigned int | period | |||
| ) | [private] |
Definition at line 337 of file LinkScheduleEstimator.cc.
References change, clone_subsequence(), closest_entry_to_date(), and log_dist().
Referenced by extract_schedule().
| LinkScheduleEstimator::Log * dtn::LinkScheduleEstimator::clone_subsequence | ( | Log & | log, | |
| unsigned int | start, | |||
| unsigned int | len | |||
| ) | [private] |
Definition at line 321 of file LinkScheduleEstimator.cc.
Referenced by badness_of_match(), and extract_schedule().
| unsigned int dtn::LinkScheduleEstimator::closest_entry_to_date | ( | Log & | log, | |
| unsigned int | date | |||
| ) | [private] |
return the index of the closest log entry to the given date
Definition at line 307 of file LinkScheduleEstimator.cc.
References absdiff, and seek_to_before_date().
Referenced by badness_of_match(), extract_schedule(), and refine_period().
| unsigned int dtn::LinkScheduleEstimator::entry_dist | ( | Log & | a, | |
| unsigned int | a_index, | |||
| unsigned int | a_offset, | |||
| Log & | b, | |||
| unsigned int | b_index, | |||
| unsigned int | b_offset, | |||
| unsigned int | warping_window | |||
| ) | [private] |
Definition at line 45 of file LinkScheduleEstimator.cc.
References absdiff.
Referenced by log_dist(), and log_dist_r().
| unsigned int dtn::LinkScheduleEstimator::estimate_period | ( | Log & | log | ) | [private] |
Definition at line 264 of file LinkScheduleEstimator.cc.
References absdiff, autocorrelation(), and PERIOD_TOLERANCE.
Referenced by find_schedule().
| LinkScheduleEstimator::Log * dtn::LinkScheduleEstimator::extract_schedule | ( | Log & | log, | |
| unsigned int | period_estimate | |||
| ) | [private] |
Definition at line 369 of file LinkScheduleEstimator.cc.
References badness_of_match(), clone_subsequence(), closest_entry_to_date(), pattern(), print_log(), and WARPING_WINDOW.
Referenced by find_schedule().
| LinkScheduleEstimator::Log * dtn::LinkScheduleEstimator::find_schedule | ( | LinkScheduleEstimator::Log & | log | ) | [private] |
This is the function to be called from the outside.
Definition at line 494 of file LinkScheduleEstimator.cc.
References estimate_period(), extract_schedule(), and refine_period().
| LinkScheduleEstimator::Log * dtn::LinkScheduleEstimator::generate_samples | ( | Log & | schedule, | |
| unsigned int | log_size, | |||
| unsigned int | start_jitter, | |||
| double | duration_jitter | |||
| ) | [private] |
Definition at line 216 of file LinkScheduleEstimator.cc.
| unsigned int dtn::LinkScheduleEstimator::log_dist | ( | Log & | a, | |
| unsigned int | a_offset, | |||
| Log & | b, | |||
| unsigned int | b_offset, | |||
| unsigned int | warping_window, | |||
| int | print_table | |||
| ) | [private] |
Definition at line 109 of file LinkScheduleEstimator.cc.
References dtn::dist, entry_dist(), log_dist_r(), and MAX_DIST.
Referenced by autocorrelation(), and badness_of_match().
| unsigned int dtn::LinkScheduleEstimator::log_dist_r | ( | Log & | a, | |
| unsigned int | a_index, | |||
| unsigned int | a_offset, | |||
| Log & | b, | |||
| unsigned int | b_index, | |||
| unsigned int | b_offset, | |||
| unsigned int | warping_window | |||
| ) | [private] |
Definition at line 60 of file LinkScheduleEstimator.cc.
References dtn::dist, entry_dist(), and MAX_DIST.
Referenced by log_dist().
| void dtn::LinkScheduleEstimator::print_log | ( | Log & | log, | |
| int | relative_dates | |||
| ) | [private] |
Definition at line 196 of file LinkScheduleEstimator.cc.
Referenced by extract_schedule().
| unsigned int dtn::LinkScheduleEstimator::refine_period | ( | LinkScheduleEstimator::Log & | log, | |
| unsigned int | period_estimate | |||
| ) | [private] |
Definition at line 469 of file LinkScheduleEstimator.cc.
References closest_entry_to_date(), and count.
Referenced by find_schedule().
| unsigned int dtn::LinkScheduleEstimator::seek_to_before_date | ( | Log & | log, | |
| unsigned int | date | |||
| ) | [private] |
return the index of the closest log entry at or before the given date.
Definition at line 295 of file LinkScheduleEstimator.cc.
Referenced by closest_entry_to_date().
1.6.3