本文整理汇总了Python中Interval.Interval.start方法的典型用法代码示例。如果您正苦于以下问题:Python Interval.start方法的具体用法?Python Interval.start怎么用?Python Interval.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Interval.Interval
的用法示例。
在下文中一共展示了Interval.start方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: insert
# 需要导入模块: from Interval import Interval [as 别名]
# 或者: from Interval.Interval import start [as 别名]
def insert(self, intervals, newInterval):
if len(intervals) == 0:
return [newInterval]
r = []
overlapWithNewInterval = Interval(newInterval.start, newInterval.end)
didAddNewInterval = False
for i in intervals:
if (i.start < overlapWithNewInterval.start
and i.end < overlapWithNewInterval.start):
r.append(i)
elif (i.start < overlapWithNewInterval.start
and i.end >= overlapWithNewInterval.start
and i.end <= overlapWithNewInterval.end):
overlapWithNewInterval.start = i.start
elif (i.start < overlapWithNewInterval.start
and i.end > overlapWithNewInterval.end):
return intervals
elif (i.start >= overlapWithNewInterval.start
and i.end <= overlapWithNewInterval.end):
pass
elif (i.start >= overlapWithNewInterval.start
and i.start <= overlapWithNewInterval.end
and i.end >= overlapWithNewInterval.end):
overlapWithNewInterval.end = i.end
else: # hxl: i is after overlapWithNewInterval
if didAddNewInterval == False:
r.append(overlapWithNewInterval)
didAddNewInterval = True
r.append(i)
# hxl: It's possible that the new interval is not added yet!
if didAddNewInterval == False:
r.append(overlapWithNewInterval)
didAddNewInterval = True
return r
示例2: start
# 需要导入模块: from Interval import Interval [as 别名]
# 或者: from Interval.Interval import start [as 别名]
def start(self,*args,**kwargs):
self.particleEffect.clearToInitial()
self.currT = 0
Interval.start(self,*args,**kwargs)