280 }
281 **r e t u r n** belief ;
282 }
283 284 /∗∗
285 ∗ Remove th e a s s i gnm e n t r e l a t e d t o p r o p o s i t i o n <i>a P r o p o s i t **i o n </ i >, i f t h e r e i s** 286 ∗ **su ch a s s i gnm e n t s t o r e d w i t h i n <i>t h i s </ i >.**
287 ∗ **Return th e v a l u e a s s i g n e d t o th e p r o p o s i t i o n .**
288 ∗ 289 ∗/
290 @Override 291 **p u b l i c d oub l e** remove ( Prop aProposition ) { 292 Assignment <Prop> foundPair=findProposition ( aProposition ) ;
293 i f ( foundPair != n u l l ) {
294 **d oub l e** theValue=foundPair . value ; 295 bbaTreeA . remove ( foundPair ) ;
296 bbaTreeVA . remove ( foundPair ) ;
297 update_notification **( ) ;**
298 **r e t u r n** theValue ;
299 } 300 r e t u r n **0 . ;**
301 }
302 303 /∗∗
304 ∗ **Make a mix o f th e b a s i c b e l i e f a s s i gnm e n t s s t o r e d w i t h i n th e en t r y , <i>bbaIn</ i** ←֓
>
305 ∗ **a c c o r d i n g t o t h e i r r e s p e c t i v e w e i gh t <i>we ight </ i >. Th is mix i s s t o r e d i n t o <i>**←֓
t h i s </ i >.

306 ∗
307 ∗/
308 @Override 309 **p u b l i c** B mix ( ArrayList <B> bbaIn , d oub l e [ ] weight ) {
310 **i n t** nbIn=bbaIn . size **( ) ;**
311 312 i f ( nbIn <1) **r e t u r n n u l l** ;
313 i f ( nbIn != weight . length ) **r e t u r n n u l l** ;
314 **d oub l e** cumul =0; 315 **d oub l e** aValue ;
316 **i n t** i ;
317 Iterator j ;
318 Assignment <Prop> refOut ; 319 f o r ( i=0;i<nbIn ; i**++) {** 320 aValue=weight [ i ] ; 321 i f ( aValue <0) **r e t u r n n u l l** ; 322 cumul+=aValue ;
323 }
324 i f ( cumul==0) **r e t u r n n u l l** ;
325 clear **( ) ;**
326 B bbaResult=instance **( ) ;**
327 f o r ( i=0;i<nbIn ; i**++) {**
328 aValue=weight [ i ] / cumul ; 329 **f o r** ( j=( bbaIn . get ( i **) ) .** bbaTreeVA . iterator **( ) ;** j . hasNext **( ) ; ) {**
330 refOut=( Assignment <Prop >) j . next **( ) ;**
331 bbaResult . add ( refOut . attribute , aValue∗ refOut . value ) ;
332 } 333 }
334 duplicate ( bbaResult ) ; 335 update_notification **( ) ;** 336 r e t u r n ( B ) **t h i s** ;
337 }
338 339 @Override 340 **p u b l i c v o id** update_notification ( ) { **// c a l l e d ea ch t im e a chang e i s done** 341 i f ( relaxed **( ) )** relax **( ) ;** 342 **e l s e sup e r** . update_notification **( ) ;**
343 } 344 345 346 **// / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / :** 347 **// r e s e r v e d p a r t**
348 **// /////////////** 349 350 /∗∗
351 ∗ Th is method i s not a c c e s s i b l e from c l a s s { @ l ink TreeSetBBA } **and g e n e r a t e s an** ←֓
158