def __init__(self, name, delta_t, sim_rep=0, collect_stat=True, warm_up_period=0): """ :param name: name of this sample path :param delta_t: length of equally-spaced observation periods :param sim_rep: (int) simulation replication of this sample path :param collect_stat: set to True to collect statistics on average, max, min, stDev, etc for this sample path :param warm_up_period: warm up period (observations before this time will not be used to calculate statistics) """ _SamplePath.__init__(self, name=name, sim_rep=sim_rep, collect_stat=collect_stat, warm_up_period=warm_up_period) self._deltaT = delta_t self._period_num = 0 self._warm_up_period = warm_up_period self._period_nums = [] # times represent the observation period number self._values = [] # statistics on this incidence sample path if self.ifCollectStat: self.stat = Stat.DiscreteTimeStat(name=name)
def mytest_discrete_time(data): # define a discrete-time statistics discrete_stat = Stat.DiscreteTimeStat('Test discrete-time statistics') # record data points for point in data: discrete_stat.record(point) print('Testing discrete-time statistics:') print_results(discrete_stat)