71 **// / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / :**
72 **// p u b l i c p a r t** 73 **// /////////////**
74 75 **p u b l i c d oub l e** conflict **( ) {** 76 **r e t u r n** theConflict ;
77 }
78 79 **p u b l i c** B fuse ( B left , B right , RefereeFunctionDefault <Prop> theRefereeFunction ←֓
) {
80 ArrayList <B> bbaTab= new ArrayList <B **>() ;**
81 bbaTab . add ( left ) ; 82 bbaTab . add ( right ) ;
83 **r e t u r n** fuse ( bbaTab , theRefereeFunction ) ;
84 }
85 86 87 **p u b l i c** B fuse ( ArrayList <B> bbaIn , RefereeFunctionDefault <Prop> ←֓
theRefereeFunction ) {
88 **i n t** nbIn ;
89 **i n t** k , l ;
90 **d oub l e** Norm ; 91 nbIn=bbaIn . size **( ) ;**
92 i f ( nbIn <1) **r e t u r n n u l l** ;
93 Iterator [ ] j**=new** Iterator [ nbIn ] ;
94 ArrayList <Assignment <Prop>> assignIn = new ArrayList <Assignment <Prop **>>() ;** 95 BBASources . clear **( ) ;**
96 f o r ( k=0;k<nbIn ; k**++) {**
97 assignIn . add ( n u l l ) ; 98 BBASources . add ( bbaIn . get ( k **) ) ;**
99 } **// Ch e r ch e r mieux ?**
100 //
101 d oub l e [ ] propEval= new d oub l e [1+ nbIn ] ; 102 propEval [ nbIn **] = 1 . ;**
103 ArrayList <Assignment <Prop>> refOut ;
104 Assignment <Prop> aTmpAssign ;
105 B bbaResult= instance **( ) ;** 106 bbaResult . clear **( ) ;**
107 f o r ( k=0;k<nbIn ; k++) j [ k]= bbaIn . get ( k ) . bbaTreeVA . iterator **( ) ;**
108 **f o r** ( k=nbIn −1;k<nbIn **; ) {**
109 i f ( j [ k ] . hasNext **( ) ) {** 110 aTmpAssign=( Assignment <Prop >) j [ k ] . next **( ) ;** 111 assignIn . set ( k , aTmpAssign ) ; 112 propEval [ k ]= propEval [ k+1]∗ aTmpAssign . value ; 113 i f ( k**==0) {**
114 refOut=theRefereeFunction . refereeFunction ( assignIn , BBASources )←֓
;
115 f o r ( l =0;l<refOut . size ( ) ; l++)
116 bbaResult . add ( refOut . get ( l ) . attribute ,
117 propEval **[ 0 ]** ∗ refOut . get ( l ) . value ) ;
118 } **e l s e** {
119 k−−;
120 }
121 } **e l s e** {
122 j [ k ]= bbaIn . get ( k ) . bbaTreeVA . iterator **( ) ;** 123 k++;
124 }
125 }
126 bbaResult . update_notification **( ) ;**
127 Norm **= 0 . ;**
128 i f ( theZero**==n u l l** )
129 theZero=bbaResult . bbaTreeA . first **( ) .** attribute . instanceNsize **( ) .** ←֓
zero **( ) ;**
130 theConflict=bbaResult . remove ( theZero ) ; 131 **f o r** ( Iterator<Assignment <Prop>> it = bbaResult . bbaTreeA . iterator **( ) ;**
132 it . hasNext **( ) ; ) {**
133 Assignment <Prop> currentPair=it . next **( ) ;**
134 Norm+=currentPair . value ;
135 }
136 clear **( ) ;** 137 **f o r** ( Iterator<Assignment <Prop>> it = bbaResult . bbaTreeA . iterator **( ) ;** 138 it . hasNext **( ) ; ) {** 139 Assignment <Prop> currentPair=it . next **( ) ;**
140 currentPair . value/=Norm ;