Skip to content

Commit

Permalink
Merge bbc98b5 into 3a9b827
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelhglass committed Jun 12, 2018
2 parents 3a9b827 + bbc98b5 commit 8f3df63
Show file tree
Hide file tree
Showing 134 changed files with 2,902 additions and 1,204 deletions.
579 changes: 579 additions & 0 deletions info/eclipse_formatter.xml

Large diffs are not rendered by default.

102 changes: 62 additions & 40 deletions src/main/java/org/jreliability/bdd/BDD.java
@@ -1,24 +1,28 @@
/**
* JReliability is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
/*******************************************************************************
* JReliability is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* JReliability is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
*
* JReliability is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License along with Opt4J. If not, see
* http://www.gnu.org/licenses/.
*/
*
* You should have received a copy of the GNU Lesser General Public License
* along with JReliability. If not, see http://www.gnu.org/licenses/.
*******************************************************************************/

package org.jreliability.bdd;

import java.util.Collection;
import java.util.Iterator;
import java.util.Set;

/**
* The {@link BDD} is an interface containing the very basic functionality of a {@link BDD}. Thus, it is used as a front
* end for the various available BDD packages.
* The {@link BDD} is an interface containing the very basic functionality of a
* {@link BDD}. Thus, it is used as a front end for the various available BDD
* packages.
*
* @author glass, reimann
*
Expand All @@ -28,14 +32,16 @@
public interface BDD<T> {

/**
* Returns a {@link BDD} {@link Iterator} containing all satisfying variable assignments.
* Returns a {@link BDD} {@link Iterator} containing all satisfying variable
* assignments.
*
* @return all satisfying variable assignments
*/
public Iterator<BDD<T>> allsat();

/**
* Returns the logical {@code and} of two BDDs. Note: Both BDDs remain unchanged after this and-operation.
* Returns the logical {@code and} of two BDDs. Note: Both BDDs remain
* unchanged after this and-operation.
*
* @param that
* the BDD to and with this BDD
Expand All @@ -44,16 +50,18 @@ public interface BDD<T> {
public BDD<T> and(BDD<T> that);

/**
* Makes this BDD the logical {@code and} of this and {@code that} {@link BDD}. Note: {@code That} BDD is
* consumed(!) within this operation and invalid afterwards.
* Makes this BDD the logical {@code and} of this and {@code that}
* {@link BDD}. Note: {@code That} BDD is consumed(!) within this operation
* and invalid afterwards.
*
* @param that
* the BDD to and with this BDD
*/
public void andWith(BDD<T> that);

/**
* Makes this BDD the logical {@code and} of this and {@code that} variables.
* Makes this BDD the logical {@code and} of this and {@code that}
* variables.
*
* @param that
* the variables to and with this BDD
Expand Down Expand Up @@ -81,20 +89,24 @@ public interface BDD<T> {
public boolean equals(Object that);

/**
* Returns this {@link BDD} after an existential quantification of the specified variable.
* Returns this {@link BDD} after an existential quantification of the
* specified variable.
*
* @param variable
* the variable for the existential quantification
* @return this BDD after an existential quantification of the specified variables
* @return this BDD after an existential quantification of the specified
* variables
*/
public BDD<T> exist(T variable);

/**
* Returns this {@link BDD} after a universal quantification of the specified variable.
* Returns this {@link BDD} after a universal quantification of the
* specified variable.
*
* @param variable
* the variable for the universal quantification
* @return this BDD after a universal quantification of the specified variables
* @return this BDD after a universal quantification of the specified
* variables
*/
public BDD<T> forAll(T variable);

Expand Down Expand Up @@ -134,8 +146,9 @@ public interface BDD<T> {
public boolean isZero();

/**
* Returns the if-then-else} {@link BDD} with this {@link BDD} being the if, the {@code thenBDD} being the then and
* {@code elseBDD} being the else statement.
* Returns the if-then-else} {@link BDD} with this {@link BDD} being the if,
* the {@code thenBDD} being the then and {@code elseBDD} being the else
* statement.
*
* @param thenBDD
* the BDD for the then statement
Expand Down Expand Up @@ -174,7 +187,8 @@ public interface BDD<T> {
public int nodeCount();

/**
* Returns the logical or of two {@link BDD}s. Note: Both BDDs remain unchanged after this or-operation.
* Returns the logical or of two {@link BDD}s. Note: Both BDDs remain
* unchanged after this or-operation.
*
* @param that
* the BDD to or with this BDD
Expand All @@ -183,8 +197,9 @@ public interface BDD<T> {
public BDD<T> or(BDD<T> that);

/**
* Makes this BDD the logical or of this and {@code that} {@link BDD}. Note: {@code That} BDD is consumed(!) within
* this operation and invalid afterwards.
* Makes this BDD the logical or of this and {@code that} {@link BDD}. Note:
* {@code That} BDD is consumed(!) within this operation and invalid
* afterwards.
*
* @param that
* the BDD to or with this BDD
Expand All @@ -208,19 +223,21 @@ public interface BDD<T> {
public void orWith(T that);

/**
* Returns a {@link BDD} where the variable for {@code variable1} is replaced with the variable of
* {@code variable2}.
* Returns a {@link BDD} where the variable for {@code variable1} is
* replaced with the variable of {@code variable2}.
*
* @param variable1
* the first variable
* @param variable2
* the second variable
* @return a BDD where the variable for variable1 is replaced with the variable of variable2
* @return a BDD where the variable for variable1 is replaced with the
* variable of variable2
*/
public BDD<T> replace(T variable1, T variable2);

/**
* Replaces the variable for {@code variable1} with the variable of {@code variable2} in this {@link BDD}.
* Replaces the variable for {@code variable1} with the variable of
* {@code variable2} in this {@link BDD}.
*
* @param variable1
* the first variable
Expand All @@ -230,8 +247,9 @@ public interface BDD<T> {
public void replaceWith(T variable1, T variable2);

/**
* Returns a {@link BDD} where the variables of {@code that} {@link BDD} are set to constant reliabilityFunctions in
* this BDD. Note: Both BDDs remain unchanged after this or-operation.
* Returns a {@link BDD} where the variables of {@code that} {@link BDD} are
* set to constant reliabilityFunctions in this BDD. Note: Both BDDs remain
* unchanged after this or-operation.
*
* @param that
* the BDD to restrict this BDD with
Expand All @@ -240,8 +258,9 @@ public interface BDD<T> {
public BDD<T> restrict(BDD<T> that);

/**
* Restricts the variables of {@code that} to constant reliabilityFunctions in this BDD. Note: {@code That} BDD is
* consumed(!) within this operation and invalid afterwards.
* Restricts the variables of {@code that} to constant reliabilityFunctions
* in this BDD. Note: {@code That} BDD is consumed(!) within this operation
* and invalid afterwards.
*
* @param that
* the BDD to restrict this BDD with
Expand All @@ -256,7 +275,8 @@ public interface BDD<T> {
public T var();

/**
* Returns the logical xor of two {@link BDD}s. Note: Both BDDs remain unchanged after this xor-operation.
* Returns the logical xor of two {@link BDD}s. Note: Both BDDs remain
* unchanged after this xor-operation.
*
* @param that
* the BDD to xor with this BDD
Expand All @@ -265,8 +285,9 @@ public interface BDD<T> {
public BDD<T> xor(BDD<T> that);

/**
* Makes this {@link BDD} the logical xor of this and {@code that} BDD. Note: {@code That} BDD is consumed(!) within
* this operation and invalid afterwards.
* Makes this {@link BDD} the logical xor of this and {@code that} BDD.
* Note: {@code That} BDD is consumed(!) within this operation and invalid
* afterwards.
*
* @param that
* the BDD to xor with this BDD
Expand All @@ -282,7 +303,8 @@ public interface BDD<T> {
public void xorWith(T that);

/**
* Returns the logical implication of two {@link BDD}s. Note: Both BDDs remain unchanged after this and-operation.
* Returns the logical implication of two {@link BDD}s. Note: Both BDDs
* remain unchanged after this and-operation.
*
* @param that
* the BDD to implicate with this BDD
Expand All @@ -291,8 +313,8 @@ public interface BDD<T> {
public BDD<T> imp(BDD<T> that);

/**
* Returns the logical implication of two {@link BDD}s. Note: {@code That} BDD is consumed(!) within this operation
* and invalid afterwards.
* Returns the logical implication of two {@link BDD}s. Note: {@code That}
* BDD is consumed(!) within this operation and invalid afterwards.
*
* @param that
* the BDD to implicate with this BDD
Expand Down
23 changes: 13 additions & 10 deletions src/main/java/org/jreliability/bdd/BDDConstraint.java
@@ -1,15 +1,18 @@
/**
* JReliability is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
/*******************************************************************************
* JReliability is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* JReliability is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
*
* JReliability is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License along with Opt4J. If not, see
* http://www.gnu.org/licenses/.
*/
*
* You should have received a copy of the GNU Lesser General Public License
* along with JReliability. If not, see http://www.gnu.org/licenses/.
*******************************************************************************/

package org.jreliability.bdd;

import java.util.ArrayList;
Expand Down
23 changes: 13 additions & 10 deletions src/main/java/org/jreliability/bdd/BDDProvider.java
@@ -1,15 +1,18 @@
/**
* JReliability is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
/*******************************************************************************
* JReliability is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* JReliability is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
*
* JReliability is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License along with Opt4J. If not, see
* http://www.gnu.org/licenses/.
*/
*
* You should have received a copy of the GNU Lesser General Public License
* along with JReliability. If not, see http://www.gnu.org/licenses/.
*******************************************************************************/

package org.jreliability.bdd;

import java.util.List;
Expand Down
23 changes: 13 additions & 10 deletions src/main/java/org/jreliability/bdd/BDDProviderFactory.java
@@ -1,15 +1,18 @@
/**
* JReliability is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
/*******************************************************************************
* JReliability is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* JReliability is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
*
* JReliability is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License along with Opt4J. If not, see
* http://www.gnu.org/licenses/.
*/
*
* You should have received a copy of the GNU Lesser General Public License
* along with JReliability. If not, see http://www.gnu.org/licenses/.
*******************************************************************************/

package org.jreliability.bdd;

/**
Expand Down
36 changes: 21 additions & 15 deletions src/main/java/org/jreliability/bdd/BDDReliabilityFunction.java
@@ -1,24 +1,27 @@
/**
* JReliability is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
/*******************************************************************************
* JReliability is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* JReliability is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
*
* JReliability is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License along with Opt4J. If not, see
* http://www.gnu.org/licenses/.
*/
*
* You should have received a copy of the GNU Lesser General Public License
* along with JReliability. If not, see http://www.gnu.org/licenses/.
*******************************************************************************/

package org.jreliability.bdd;

import org.apache.commons.collections15.Transformer;
import org.jreliability.function.Distribution;
import org.jreliability.function.ReliabilityFunction;

/**
* The {@link BDDReliabilityFunction} represents the {@link ReliabilityFunction} that is inherently included in a
* {@link BDD}.
* The {@link BDDReliabilityFunction} represents the {@link ReliabilityFunction}
* that is inherently included in a {@link BDD}.
*
* @author glass
*
Expand All @@ -33,7 +36,8 @@ public class BDDReliabilityFunction<T> implements ReliabilityFunction {
protected final BDD<T> bdd;

/**
* The used {@link Transformer} to get the {@link ReliabilityFunction} of each element of the {@link BDD}.
* The used {@link Transformer} to get the {@link ReliabilityFunction} of
* each element of the {@link BDD}.
*/
protected final Transformer<T, ReliabilityFunction> functionTransformer;

Expand All @@ -43,13 +47,15 @@ public class BDDReliabilityFunction<T> implements ReliabilityFunction {
protected final BDDTopEvent<T> topEvent;

/**
* Constructs a {@link BDDReliabilityFunction} with a given {@link BDD} and {@link Transformer}.
* Constructs a {@link BDDReliabilityFunction} with a given {@link BDD} and
* {@link Transformer}.
*
* @param bdd
* the bdd representing the reliabilityFunction
*
* @param functionTransformer
* the functionTransformer to transform bdd elements to reliabilityFunction
* the functionTransformer to transform bdd elements to
* reliabilityFunction
*/
public BDDReliabilityFunction(BDD<T> bdd, Transformer<T, ReliabilityFunction> functionTransformer) {
super();
Expand Down

0 comments on commit 8f3df63

Please sign in to comment.