hylar/core/Logics/Logics.js
function(fs, subset) {
        for (var i = 0; i < fs.length; i++) {
            for (var j = 0; j < subset.length; j++) {
                if ((subset[j] !== undefined) && (fs[i].equivalentTo(subset[j]))) {
                    fs[i].causedBy = this.uniquesCausedBy(fs[i].causedBy, subset[j].causedBy);
                    fs[i].consequences = fs[i].consequences.concat(subset[j].consequences);
                    subset[j].doPropagate(fs[i]);                                                            
                    delete subset[j];
                }
            }
        }
        for (i = 0; i < subset.length; i++) {
            if (subset[i] !== undefined) fs.push(subset[i]);
        }
    }
function(fs, subset) {
        for (var i = 0; i < fs.length; i++) {
            for (var j = 0; j < subset.length; j++) {
                if ((subset[j] !== undefined) && (fs[i].equivalentTo(subset[j]))) {
                    fs[i].causedBy = this.uniquesCausedBy(fs[i].causedBy, subset[j].causedBy);
                    fs[i].consequences = fs[i].consequences.concat(subset[j].consequences);
                    subset[j].doPropagate(fs[i]);                                                            
                    delete subset[j];
                }
            }
        }
        for (i = 0; i < subset.length; i++) {
            if (subset[i] !== undefined) fs.push(subset[i]);
        }
    }
function ( fs , subset ) { for ( var i = 0 ; i < fs . length ; i ++ ) { for ( var j = 0 ; j < subset . length ; j ++ ) { if ( ( subset [ j ] !== undefined ) && ( fs [ i ] . equivalentTo ( subset [ j ] ) ) ) { fs [ i ] . causedBy = this . uniquesCausedBy ( fs [ i ] . causedBy , subset [ j ] . causedBy ) ; fs [ i ] . consequences = fs [ i ] . consequences . concat ( subset [ j ] . consequences ) ; subset [ j ] . doPropagate ( fs [ i ] ) ; delete subset [ j ] ; } } } for ( i = 0 ; i < subset . length ; i ++ ) { if ( subset [ i ] !== undefined ) fs . push ( subset [ i ] ) ; } }
True-like merge of two facts sets, which also merges
identical facts causedBy properties.
@param fs1
@param fs2
True - like merge of two facts sets which also merges identical facts causedBy properties .