Commit 194cc697 authored by Sulfyderz's avatar Sulfyderz
Browse files

[Error Update]:Improving automaton Boundary Create Action.

parent 6d30be00
......@@ -1368,6 +1368,17 @@ class Show(object):
# permet de savoir si on fait les traitements pour des segments avec des mauvaises frontieres
perfectBoundary=False
listHypRefSegment=list()
for y in valueTmp:
if Segment.intersection(y,valueRef) is not None:
if tolerance==0:
listHypRefSegment.append(y)
elif tolerance!=0 and y['start']>=(valueRef['start']-tolerance):
#NEW LALA
if not y['start']>=(valueRef['stop']-tolerance):
#NEW LALA
listHypRefSegment.append(y)
# si frontiere parfaite
if len(listHypRefSegment)==1 and DiarTools.boundariesInTolerance(boundarySegment=listHypRefSegment[0],segment=valueRef,tolerance=tolerance):
actionsSegmentationNothingThr.append(copy.deepcopy(listHypRefSegment[0]))
......@@ -1380,12 +1391,12 @@ class Show(object):
# on coupe si frontiere pas ok pour rester que dans le segment de reference
if z['stop']>(valueRef['stop']+tolerance):
#NEW LALA
if not z['start']>=(valueRef['stop']-tolerance):
#NEW LALA
actionsSegmentationBoundaryCreateThr.append(copy.deepcopy([z,valueRef['stop']]))
if actionsIncremental:
actionsIncrementalSegmentationBoundaryCreateThrTurn.append(copy.deepcopy([z,valueRef['stop']]))
valueTmp=DiarTools.splitSegment(z,valueTmp,valueRef['stop'])
#if not z['start']>=(valueRef['stop']-tolerance):
# #NEW LALA
actionsSegmentationBoundaryCreateThr.append(copy.deepcopy([z,valueRef['stop']]))
if actionsIncremental:
actionsIncrementalSegmentationBoundaryCreateThrTurn.append(copy.deepcopy([z,valueRef['stop']]))
valueTmp=DiarTools.splitSegment(z,valueTmp,valueRef['stop'])
if tolerance!=0:
valueTmp2=copy.deepcopy(valueTmp)
......@@ -2268,6 +2279,17 @@ class Show(object):
else:
# permet de savoir si on fait les traitements pour des segments avec des mauvaises frontieres
perfectBoundary=False
listHypRefSegment=list()
for y in valueTmp:
if Segment.intersection(y,valueRef) is not None:
if tolerance==0:
listHypRefSegment.append(y)
elif tolerance!=0 and y['start']>=(valueRef['start']-tolerance):
#NEW LALA
if not y['start']>=(valueRef['stop']-tolerance):
#NEW LALA
listHypRefSegment.append(y)
# si frontiere parfaite
if len(listHypRefSegment)==1 and DiarTools.boundariesInTolerance(boundarySegment=listHypRefSegment[0],segment=valueRef,tolerance=tolerance):
actionsSegmentationNothingThr.append(copy.deepcopy(listHypRefSegment[0]))
......@@ -2285,12 +2307,12 @@ class Show(object):
# on coupe si frontiere pas ok pour rester que dans le segment de reference
if z['stop']>(valueRef['stop']+tolerance):
#NEW LALA
if not z['start']>=(valueRef['stop']-tolerance):
#NEW LALA
actionsSegmentationBoundaryCreateThr.append(copy.deepcopy([z,valueRef['stop']]))
if actionsIncremental:
actionsIncrementalSegmentationBoundaryCreateThrTurn.append(copy.deepcopy([z,valueRef['stop']]))
valueTmp=DiarTools.splitSegment(z,valueTmp,valueRef['stop'])
#if not z['start']>=(valueRef['stop']-tolerance):
# #NEW LALA
actionsSegmentationBoundaryCreateThr.append(copy.deepcopy([z,valueRef['stop']]))
if actionsIncremental:
actionsIncrementalSegmentationBoundaryCreateThrTurn.append(copy.deepcopy([z,valueRef['stop']]))
valueTmp=DiarTools.splitSegment(z,valueTmp,valueRef['stop'])
# Enleve les segments compris dans la marge tolérance (+ ou - tolérance)
if tolerance!=0:
......@@ -3004,6 +3026,17 @@ class Show(object):
# permet de savoir si on fait les traitements pour des segments avec des mauvaises frontieres
perfectBoundary=False
listHypRefSegment=list()
for y in valueTmp:
if Segment.intersection(y,valueRef) is not None:
if tolerance==0:
listHypRefSegment.append(y)
elif tolerance!=0 and y['start']>=(valueRef['start']-tolerance):
#NEW LALA
if not y['start']>=(valueRef['stop']-tolerance):
#NEW LALA
listHypRefSegment.append(y)
# si frontiere parfaite
if len(listHypRefSegment)==1 and DiarTools.boundariesInTolerance(boundarySegment=listHypRefSegment[0],segment=valueRef,tolerance=tolerance):
actionsSegmentationNothingThr.append(copy.deepcopy(listHypRefSegment[0]))
......@@ -3016,12 +3049,12 @@ class Show(object):
# on coupe si frontiere pas ok pour rester que dans le segment de reference
if z['stop']>(valueRef['stop']+tolerance):
#NEW LALA
if not z['start']>=(valueRef['stop']-tolerance):
#NEW LALA
actionsSegmentationBoundaryCreateThr.append(copy.deepcopy([z,valueRef['stop']]))
if actionsIncremental:
actionsIncrementalSegmentationBoundaryCreateThrTurn.append(copy.deepcopy([z,valueRef['stop']]))
valueTmp=DiarTools.splitSegment(z,valueTmp,valueRef['stop'])
#if not z['start']>=(valueRef['stop']-tolerance):
# #NEW LALA
actionsSegmentationBoundaryCreateThr.append(copy.deepcopy([z,valueRef['stop']]))
if actionsIncremental:
actionsIncrementalSegmentationBoundaryCreateThrTurn.append(copy.deepcopy([z,valueRef['stop']]))
valueTmp=DiarTools.splitSegment(z,valueTmp,valueRef['stop'])
if tolerance!=0:
valueTmp2=copy.deepcopy(valueTmp)
......@@ -3998,6 +4031,17 @@ class Show(object):
else:
# permet de savoir si on fait les traitements pour des segments avec des mauvaises frontieres
perfectBoundary=False
listHypRefSegment=list()
for y in valueTmp:
if Segment.intersection(y,valueRef) is not None:
if tolerance==0:
listHypRefSegment.append(y)
elif tolerance!=0 and y['start']>=(valueRef['start']-tolerance):
#NEW LALA
if not y['start']>=(valueRef['stop']-tolerance):
#NEW LALA
listHypRefSegment.append(y)
# si frontiere parfaite
if len(listHypRefSegment)==1 and DiarTools.boundariesInTolerance(boundarySegment=listHypRefSegment[0],segment=valueRef,tolerance=tolerance):
actionsSegmentationNothingThr.append(copy.deepcopy(listHypRefSegment[0]))
......@@ -4013,12 +4057,12 @@ class Show(object):
# on coupe si frontiere pas ok pour rester que dans le segment de reference
if z['stop']>(valueRef['stop']+tolerance):
#NEW LALA
if not z['start']>=(valueRef['stop']-tolerance):
#NEW LALA
actionsSegmentationBoundaryCreateThr.append(copy.deepcopy([z,valueRef['stop']]))
if actionsIncremental:
actionsIncrementalSegmentationBoundaryCreateThrTurn.append(copy.deepcopy([z,valueRef['stop']]))
valueTmp=DiarTools.splitSegment(z,valueTmp,valueRef['stop'])
#if not z['start']>=(valueRef['stop']-tolerance):
# #NEW LALA
actionsSegmentationBoundaryCreateThr.append(copy.deepcopy([z,valueRef['stop']]))
if actionsIncremental:
actionsIncrementalSegmentationBoundaryCreateThrTurn.append(copy.deepcopy([z,valueRef['stop']]))
valueTmp=DiarTools.splitSegment(z,valueTmp,valueRef['stop'])
# Enleve les segments compris dans la marge tolérance (+ ou - tolérance)
if tolerance!=0:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment