Commit d19096c1 authored by Sebastian Vollbrecht's avatar Sebastian Vollbrecht

Merge branch 'infeasibleRefactoring'

Closes #2.
parents 727102c0 129f3a2d
......@@ -20,9 +20,8 @@ package graphgen.datastructures;
import java.util.Objects;
/**
* A basic class for arranging objects in pairs. Every pairing is immutable once
* created. To create a pair, use the static
* {@link Pair#makePair(Object, Object)} constructor.
* A basic class for arranging objects in pairs. Every pairing is immutable once created. To create a pair, use the
* static {@link Pair#makePair(Object, Object)} constructor.
*
* @param <T1> the type of the first element
* @param <T2> the type of the second element
......@@ -89,7 +88,8 @@ public class Pair<T1, T2> {
return false;
if (second == null) {
return other.second == null;
} else return second.equals(other.second);
} else
return second.equals(other.second);
}
}
......@@ -21,10 +21,8 @@ import java.util.Optional;
import java.util.Random;
/**
* A wrapper class for {@link Random} instances. This class disallows random
* number generation without having seeded the wrapped random instance
* beforehand, so that the graph generator does not generate 'true' random
* numbers by accident.
* A wrapper class for {@link Random} instances. This class disallows random number generation without having seeded the
* wrapped random instance beforehand, so that the graph generator does not generate 'true' random numbers by accident.
*
* @author Sebastian Vollbrecht
*/
......@@ -35,8 +33,8 @@ public class SeededRandom {
private final Random rng;
/**
* Creates a new, unseeded SeededRandom instance. Before random numbers can be
* generated, a call to the {@link #setSeed(long)} method will be necessary.
* Creates a new, unseeded SeededRandom instance. Before random numbers can be generated, a call to the {@link
* #setSeed(long)} method will be necessary.
*/
public SeededRandom() {
this.rng = new Random();
......@@ -44,8 +42,8 @@ public class SeededRandom {
}
/**
* Creates a new, seeded SeededRandom instance. Using this constructor, a call
* to the {@link #setSeed(long)} method is unnecessary.
* Creates a new, seeded SeededRandom instance. Using this constructor, a call to the {@link #setSeed(long)} method
* is unnecessary.
*
* @param seed the seed to pass to the random instance
*/
......@@ -65,13 +63,11 @@ public class SeededRandom {
}
/**
* Returns a random integer value between 0 (inclusive) and the given bound
* (exclusive).
* Returns a random integer value between 0 (inclusive) and the given bound (exclusive).
*
* @param bound the given bound
* @return the random integer value
* @throws UnsupportedOperationException if this instance has not yet been
* seeded
* @throws UnsupportedOperationException if this instance has not yet been seeded
*/
public int nextInt(int bound) {
checkSeededStatus();
......@@ -82,8 +78,7 @@ public class SeededRandom {
* Returns a random double value between 0.0 (inclusive) and 1.0 (exclusive).
*
* @return the random double value
* @throws UnsupportedOperationException if this instance has not yet been
* seeded
* @throws UnsupportedOperationException if this instance has not yet been seeded
*/
public double nextDouble() {
checkSeededStatus();
......@@ -94,8 +89,7 @@ public class SeededRandom {
* Returns the wrapped random instance.
*
* @return the wrapped instance
* @throws UnsupportedOperationException if this instance has not yet been
* seeded
* @throws UnsupportedOperationException if this instance has not yet been seeded
*/
public Random getRandom() {
checkSeededStatus();
......
......@@ -21,9 +21,8 @@ import modsched.Edge;
import modsched.Node;
/**
* An enumeration which stores possible edge types. The {@link #ALL} type is
* meant to be a representative of both forward edges and backedges, similar to
* a wildcard.
* An enumeration which stores possible edge types. The {@link #ALL} type is meant to be a representative of both
* forward edges and backedges, similar to a wildcard.
*
* @author Sebastian Vollbrecht
*/
......
......@@ -47,9 +47,8 @@ public enum EdgeValue {
BACKEDGE_DISTANCE;
/**
* Returns whether the given edge matches this edge value constant. This is
* useful to filter out backedges when the edge delay is needed, or forward
* edges when either the backedge delay or the backedge distance are needed.
* Returns whether the given edge matches this edge value constant. This is useful to filter out backedges when the
* edge delay is needed, or forward edges when either the backedge delay or the backedge distance are needed.
*
* @param <N> the edge's node type
* @param edge the given edge
......
......@@ -21,8 +21,7 @@ import modsched.EichenbergerFormulation;
import modsched.MoovacFormulation;
/**
* An enumeration which stores possible iterative modulo scheduling formulation
* types.
* An enumeration which stores possible iterative modulo scheduling formulation types.
*
* @author Sebastian Vollbrecht
*/
......
......@@ -20,9 +20,8 @@ package graphgen.enums;
import graphgen.graph.ResourceNode;
/**
* An enumeration which stores possible resource types. The {@link #ALL} type is
* meant to be a representative of both limited and unlimited resources, similar
* to a wildcard.
* An enumeration which stores possible resource types. The {@link #ALL} type is meant to be a representative of both
* limited and unlimited resources, similar to a wildcard.
*
* @author Sebastian Vollbrecht
*/
......
......@@ -47,25 +47,20 @@ import java.util.Objects;
import java.util.Set;
/**
* This class is the main graph generation class, responsible for generating an
* arbitrary amount of directed, layered graphs, based on specified components.
* Every graph's inherent layer structure is entirely induced by its forward
* edges, meaning that no layer is allowed to have an outgoing forward
* connection to any of its parental layers. Therefore, every graph can
* This class is the main graph generation class, responsible for generating an arbitrary amount of directed, layered
* graphs, based on specified components. Every graph's inherent layer structure is entirely induced by its forward
* edges, meaning that no layer is allowed to have an outgoing forward connection to any of its parental layers.
* Therefore, every graph can
* <i>principally</i> be seen as a top-down DAG if backedges are disregarded,
* since these are not restricted to and do not contribute to the layer
* structure.
* since these are not restricted to and do not contribute to the layer structure.
* <p>
* The components include <i>creator</i> classes, responsible for creating the
* graphs' underlying layer structures, for mapping resources to nodes and for
* creating edges and backedges between nodes. Two <i>edge includers</i> decide
* the inclusion of optionally generated forward edges and backedges. At last,
* an optional <i>property</i> class can be specified, which ensures that every
* generated graph is going to exhibit very specific characteristics.
* The components include <i>creator</i> classes, responsible for creating the graphs' underlying layer structures, for
* mapping resources to nodes and for creating edges and backedges between nodes. Two <i>edge includers</i> decide the
* inclusion of optionally generated forward edges and backedges. At last, an optional <i>property</i> class can be
* specified, which ensures that every generated graph is going to exhibit very specific characteristics.
* <p>
* The generation is based on a seed. If the components do not change from graph
* generation to graph generation, two graphs generated with the same seed are
* guaranteed to be exact duplicates of one another.
* The generation is based on a seed. If the components do not change from graph generation to graph generation, two
* graphs generated with the same seed are guaranteed to be exact duplicates of one another.
*
* @author Sebastian Vollbrecht
* @see LayerCreator
......@@ -99,27 +94,22 @@ public final class GraphGenerator {
public static final ResourceNode SOURCE = new ResourceNode(0, Resource.VIRTUAL);
/**
* A virtual sink node which ensures that there exists at least one destination
* node candidate for every other node's mandatory outgoing edge.
* A virtual sink node which ensures that there exists at least one destination node candidate for every other
* node's mandatory outgoing edge.
*
* @see Resource#VIRTUAL
*/
public static final ResourceNode SINK = new ResourceNode(SOURCE.getId() + 1, Resource.VIRTUAL);
/**
* Creates a new graph generator.<br>
* This is a convenience constructor which does not ensure any properties during
* Creates a new graph generator.<br> This is a convenience constructor which does not ensure any properties during
* graph creation.
*
* @param layerCreator a layer creator used to fill the layers with node IDs
* @param nodeCreator a node creator used to create nodes for every node id
* present in the layers
* @param edgeCreator an edge creator used to connect the nodes in the
* graph with both edges and backedges
* @param edgeIncluder an edge includer which decides whether or not an
* optional edge should be included
* @param backedgeIncluder a backedge includer which decides whether or not an
* optional backedge should be included
* @param nodeCreator a node creator used to create nodes for every node id present in the layers
* @param edgeCreator an edge creator used to connect the nodes in the graph with both edges and backedges
* @param edgeIncluder an edge includer which decides whether or not an optional edge should be included
* @param backedgeIncluder a backedge includer which decides whether or not an optional backedge should be included
*/
public GraphGenerator(LayerCreator layerCreator, NodeCreator nodeCreator, EdgeCreator edgeCreator,
EdgeIncluder edgeIncluder, EdgeIncluder backedgeIncluder) {
......@@ -127,18 +117,13 @@ public final class GraphGenerator {
}
/**
* Creates a new graph generator with all generated graphs ensuring the
* specified property.
* Creates a new graph generator with all generated graphs ensuring the specified property.
*
* @param layerCreator a layer creator used to fill the layers with node IDs
* @param nodeCreator a node creator used to create nodes for every node id
* present in the layers
* @param edgeCreator an edge creator used to connect the nodes in the
* graph with both edges and backedges
* @param edgeIncluder the includer which decides whether or not an optional
* edge should be included
* @param backedgeIncluder a backedge includer which decides whether or not an
* optional backedge should be included
* @param nodeCreator a node creator used to create nodes for every node id present in the layers
* @param edgeCreator an edge creator used to connect the nodes in the graph with both edges and backedges
* @param edgeIncluder the includer which decides whether or not an optional edge should be included
* @param backedgeIncluder a backedge includer which decides whether or not an optional backedge should be included
* @param property a specific graph property
* @see LayerCreator
* @see NodeCreator
......@@ -273,25 +258,20 @@ public final class GraphGenerator {
}
/**
* Creates the specified amount of graphs, using the provided seed to initialize
* the {@link SeededRandom} instance with which the seeds for the other graphs
* will be generated.
* Creates the specified amount of graphs, using the provided seed to initialize the {@link SeededRandom} instance
* with which the seeds for the other graphs will be generated.
* <p>
* The isomorphisms flag toggles whether or not graphs will be included in the
* resulting collection which are isomorphic to already created graphs.
* The isomorphisms flag toggles whether or not graphs will be included in the resulting collection which are
* isomorphic to already created graphs.
* <p>
* The duplicate flags toggles whether or not graphs will be included in the
* resulting collection which are exact duplicates of already generated graphs.
* Please note that if the isomorphisms flag is set to false, all duplicates
* will automatically be considered isomorphisms and therefore won't be included
* in the resulting collection.
* The duplicate flags toggles whether or not graphs will be included in the resulting collection which are exact
* duplicates of already generated graphs. Please note that if the isomorphisms flag is set to false, all duplicates
* will automatically be considered isomorphisms and therefore won't be included in the resulting collection.
*
* @param seed the initial seed
* @param amount the amount of graphs to generate
* @param includeIsomorphisms true if isomorphic graphs should be included,
* otherwise false
* @param includeDuplicates true if duplicate graphs should be included,
* otherwise false
* @param includeIsomorphisms true if isomorphic graphs should be included, otherwise false
* @param includeDuplicates true if duplicate graphs should be included, otherwise false
* @return the generated graphs
*/
public Collection<Graph<ResourceNode>> createGraphs(long seed, int amount, boolean includeIsomorphisms,
......@@ -344,11 +324,10 @@ public final class GraphGenerator {
}
/**
* Sets the generator to verbose mode, i.e. that the generation process will be
* written to the provided print stream.
* Sets the generator to verbose mode, i.e. that the generation process will be written to the provided print
* stream.
* <p>
* Use <code>new PrintStream(new FileOutputStream(new File(filename))</code> to
* immediately write to a file.<br>
* Use <code>new PrintStream(new FileOutputStream(new File(filename))</code> to immediately write to a file.<br>
* <b>Warning</b>: The resulting file might be excessively large due to the
* amount of edges possible in large graphs (O(2* V^2)).
*
......@@ -360,33 +339,31 @@ public final class GraphGenerator {
}
/**
* Sets the generator to non-verbose mode, i.e. that the generation process
* won't be documented.
* Sets the generator to non-verbose mode, i.e. that the generation process won't be documented.
*/
public void setNonVerbose() {
verbose = false;
}
/**
* Makes the generator <b>strict</b>, i.e. that all components are <b>not</b>
* allowed to deviate from their specified parameters. Note that this way the
* generation process might lead to exceptions more often.
* Makes the generator <b>strict</b>, i.e. that all components are <b>not</b> allowed to deviate from their
* specified parameters. Note that this way the generation process might lead to exceptions more often.
*/
public void setStrict() {
strict = true;
}
/**
* Sets the generator to non-strict mode, i.e. that the components are allowed
* to deviate from their specified parameters (e.g. the properties are allowed
* to swap nodes around, to generate edges with specific delays, ...).
* Sets the generator to non-strict mode, i.e. that the components are allowed to deviate from their specified
* parameters (e.g. the properties are allowed to swap nodes around, to generate edges with specific delays, ...).
*/
public void setNonStrict() {
strict = false;
}
private void generateIncomingEdges(LayerStructure layers, Set<ResourceNode> nodes,
Map<Integer, ResourceNode> nodeTable, Map<ResourceNode, Integer> asapTimes, long seed) {
Map<Integer, ResourceNode> nodeTable, Map<ResourceNode, Integer> asapTimes,
long seed) {
for (ResourceNode dst : JavaUtils.asShuffledList(nodes, rng)) {
......@@ -619,8 +596,8 @@ public final class GraphGenerator {
int delay = edgeCreator.computeEdgeDelay(src, dst);
if (verbose) {
out.print("\t\tChecking inclusion of edge " + ++currentEdgeCount + " of " + maxEdgeCount + ": "
+ src + "--" + delay + "-->" + dst + ": ");
out.print(
"\t\tChecking inclusion of edge " + ++currentEdgeCount + " of " + maxEdgeCount + ": " + src + "--" + delay + "-->" + dst + ": ");
}
if (!edgeIncluder.includeEdge(new Edge<>(src, dst, delay, 0))) {
......@@ -691,9 +668,8 @@ public final class GraphGenerator {
int distance = edgeCreator.computeBackedgeDistance(src, dst);
if (verbose) {
out.print("\t\tChecking inclusion of backedge " + ++currentBackedgeCount + " of "
+ maxBackedgeCount + ": " + src + "--(" + delay + ", " + distance + ")-->" + dst
+ ": ");
out.print(
"\t\tChecking inclusion of backedge " + ++currentBackedgeCount + " of " + maxBackedgeCount + ": " + src + "--(" + delay + ", " + distance + ")-->" + dst + ": ");
}
if (!backedgeIncluder.includeEdge(new Edge<>(src, dst, delay, distance))) {
......@@ -788,9 +764,8 @@ public final class GraphGenerator {
}
/**
* This class is the default property class, used by the {@link GraphGenerator}
* if no specific property is supplied. It never changes a graph and never
* returns false on an edge validity check.
* This class is the default property class, used by the {@link GraphGenerator} if no specific property is supplied.
* It never changes a graph and never returns false on an edge validity check.
*
* @author Sebastian Vollbrecht
* @see Property
......@@ -825,18 +800,17 @@ public final class GraphGenerator {
}
/**
* This checker is used to skip the validity checks of edges for edges that have
* been tested for property validity already. For example, if an edge needs to
* be tested for property validity in the incoming edge creation phase, it won't
* be tested again during the remaining edge creation phase.
* This checker is used to skip the validity checks of edges for edges that have been tested for property validity
* already. For example, if an edge needs to be tested for property validity in the incoming edge creation phase, it
* won't be tested again during the remaining edge creation phase.
*
* @author Sebastian Vollbrecht
*/
private class EdgeInclusionDuplicateChecker {
/**
* Maps source nodes to maps of destination nodes edge delays for which the
* property edge validity check has been executed already.
* Maps source nodes to maps of destination nodes edge delays for which the property edge validity check has
* been executed already.
*/
private final Map<ResourceNode, Map<ResourceNode, Set<Integer>>> checkedEdgeInclusions;
......@@ -850,8 +824,7 @@ public final class GraphGenerator {
* @param src the edge's source node
* @param dst the edge's destination node
* @param delay the edge's delay
* @return true if the generator has attempted to create this edge already,
* otherwise false
* @return true if the generator has attempted to create this edge already, otherwise false
*/
private boolean hasEdgeBeenDeniedAlready(ResourceNode src, ResourceNode dst, int delay) {
......
......@@ -20,26 +20,25 @@ package graphgen.generator.components;
import graphgen.datastructures.SeededRandom;
/**
* An interface which all components participating in the creation of graphs can
* implement. It provides initialization methods.
* An interface which all components participating in the creation of graphs can implement. It provides initialization
* methods.
*
* @author Sebastian Vollbrecht
*/
public interface Initializable {
/**
* Grants the implementing class access to the graph generator's random number
* generator. This method is called only <i>once</i> when the generator itself
* is constructed.
* Grants the implementing class access to the graph generator's random number generator. This method is called
* only
* <i>once</i> when the generator itself is constructed.
*
* @param rng the graph generator's random number generator
*/
public abstract void init(SeededRandom rng);
/**
* Resets the implementing class, preparing it for the generation of a new
* graph. This method is called every time before the generator begins
* generating a new graph.
* Resets the implementing class, preparing it for the generation of a new graph. This method is called every time
* before the generator begins generating a new graph.
*/
public abstract void reset();
}
......@@ -24,28 +24,24 @@ import graphgen.graph.ResourceNode;
import java.util.Map;
/**
* An interface which all classes participating in the creation of edges must
* implement. It provides setter methods for layer structures and ASAP times
* maps, which are useful for edge creation components which use the nodes'
* depths.
* An interface which all classes participating in the creation of edges must implement. It provides setter methods for
* layer structures and ASAP times maps, which are useful for edge creation components which use the nodes' depths.
*
* @author Sebastian Vollbrecht
*/
public interface EdgeCreationComponent extends Initializable {
/**
* Sets the layer structure of the implementing class, which can be used
* optionally for different purposes, such as edge validity checks or edge value
* computations regarding the depth of nodes.
* Sets the layer structure of the implementing class, which can be used optionally for different purposes, such as
* edge validity checks or edge value computations regarding the depth of nodes.
*
* @param layers the layer structure to use
*/
public abstract void setLayerStructure(LayerStructure layers);
/**
* Sets the ASAP times map of the implementing class, which can be used
* optionally for different purposes, such as backedge validity checks or
* backedge value computations regarding the 'ASAP depth' of nodes.
* Sets the ASAP times map of the implementing class, which can be used optionally for different purposes, such as
* backedge validity checks or backedge value computations regarding the 'ASAP depth' of nodes.
*
* @param asapTimes the ASAP times map to use
*/
......
......@@ -36,16 +36,12 @@ import java.util.Map;
import java.util.Set;
/**
* This class is the main component used by the {@link GraphGenerator} and
* {@link Property} classes to create edges. It contains three value computers
* to compute edge delays, backedge delays and backedge distances respectively.
* It furthermore contains many useful methods for accessing incoming and
* outgoing (back)edges. Whenever an edge is created, the edge creator
* automatically checks whether or not the edge is valid and throws exceptions
* accordingly.
* This class is the main component used by the {@link GraphGenerator} and {@link Property} classes to create edges. It
* contains three value computers to compute edge delays, backedge delays and backedge distances respectively. It
* furthermore contains many useful methods for accessing incoming and outgoing (back)edges. Whenever an edge is
* created, the edge creator automatically checks whether or not the edge is valid and throws exceptions accordingly.
* <p>
* The EdgeCreator serves as subject of the observer pattern, notifying its
* observers whenever an edge is created.
* The EdgeCreator serves as subject of the observer pattern, notifying its observers whenever an edge is created.
*
* @author Sebastian Vollbrecht
* @see ValueComputer
......@@ -68,15 +64,11 @@ public class EdgeCreator extends Observable<Edge<ResourceNode>> implements EdgeC
private boolean strict;
/**
* Constructs a new edge creator from the given value computers and the given
* edge includer.
* Constructs a new edge creator from the given value computers and the given edge includer.
*
* @param edgeDelayComputer the value computer to use to compute edge
* delays
* @param backedgeDelayComputer the value computer to use to compute backedge
* delays
* @param backedgeDistanceComputer the value computer to use to compute backedge
* distances
* @param edgeDelayComputer the value computer to use to compute edge delays
* @param backedgeDelayComputer the value computer to use to compute backedge delays
* @param backedgeDistanceComputer the value computer to use to compute backedge distances
*/
public EdgeCreator(ValueComputer edgeDelayComputer, ValueComputer backedgeDelayComputer,
ValueComputer backedgeDistanceComputer) {
......@@ -96,19 +88,17 @@ public class EdgeCreator extends Observable<Edge<ResourceNode>> implements EdgeC
}
/**
* Creates a new edge from the given source node to the given destination node
* with the given delay. Also notifies the observers of the edge creation.
* Creates a new edge from the given source node to the given destination node with the given delay. Also notifies
* the observers of the edge creation.
*
* @param src the edge's source node
* @param dst the edge's destination node
* @param delay the edge's delay
* @return the created edge
* @throws IllegalEdgeException if the delay is less than 0 or if the source and
* destination nodes are connected through a
* forward edge already
* @throws StrictModeException if the edge creator is in strict mode and any of
* the preventive measures specified in the
* {@link #setStrict(boolean)}-method isn't met
* @throws IllegalEdgeException if the delay is less than 0 or if the source and destination nodes are connected
* through a forward edge already
* @throws StrictModeException if the edge creator is in strict mode and any of the preventive measures specified
* in the {@link #setStrict(boolean)}-method isn't met
*/
public Edge<ResourceNode> createEdge(ResourceNode src, ResourceNode dst, int delay) {
......@@ -123,8 +113,8 @@ public class EdgeCreator extends Observable<Edge<ResourceNode>> implements EdgeC
int previouslyComputedDelay = computeEdgeDelay(src, dst);
if (previouslyComputedDelay != delay) {
throw new StrictModeException("The edge's delay must not deviate from the previously computed delay of "
+ previouslyComputedDelay + ".");
throw new StrictModeException(
"The edge's delay must not deviate from the previously computed delay of " + previouslyComputedDelay + ".");
}
}
......@@ -142,22 +132,18 @@ public class EdgeCreator extends Observable<Edge<ResourceNode>> implements EdgeC
}
/**
* Creates a new backedge from the given source node to the given destination
* node with the given delay and the given distance. Also notifies the observers
* of the backedge creation.
* Creates a new backedge from the given source node to the given destination node with the given delay and the
* given distance. Also notifies the observers of the backedge creation.
*
* @param src the backedge's source node
* @param dst the backedge's destination node
* @param delay the backedge's delay
* @param distance the backedge's distance
* @return the created backedge
* @throws IllegalEdgeException if the delay is less than 0, if the distance is
* not greater than 0 or if the source and
* destination nodes are connected through a
* backedge already
* @throws StrictModeException if the edge creator is in strict mode and any of
* the preventive measures specified in the
* {@link #setStrict(boolean)}-method isn't met
* @throws IllegalEdgeException if the delay is less than 0, if the distance is not greater than 0 or if the source
* and destination nodes are connected through a backedge already
* @throws StrictModeException if the edge creator is in strict mode and any of the preventive measures specified
* in the {@link #setStrict(boolean)}-method isn't met
*/
public Edge<ResourceNode> createBackedge(ResourceNode src, ResourceNode dst, int delay, int distance) {
......@@ -176,16 +162,14 @@ public class EdgeCreator extends Observable<Edge<ResourceNode>> implements EdgeC
if (previouslyComputedDelay != delay) {
throw new StrictModeException(
"The backedge's delay must not deviate from the previously computed delay of "
+ previouslyComputedDelay + ".");
"The backedge's delay must not deviate from the previously computed delay of " + previouslyComputedDelay + ".");
}
int previouslyComputedDistance = computeBackedgeDistance(src, dst);
if (previouslyComputedDistance != distance) {
throw new StrictModeException(
"The backedge's distance must not deviate from the previously computed distance of "
+ previouslyComputedDistance + ".");
"The backedge's distance must not deviate from the previously computed distance of " + previouslyComputedDistance + ".");
}
}
......@@ -195,6 +179,7 @@ public class EdgeCreator extends Observable<Edge<ResourceNode>> implements EdgeC
outgoingBackedges.get(src).add(edge);
incomingBackedges.get(dst).add(edge);
// TODO: is this check necessary?
if (src != GraphGenerator.SOURCE && dst != GraphGenerator.SINK) {
notifyObservers(edge);
}
......@@ -203,9 +188,8 @@ public class EdgeCreator extends Observable<Edge<ResourceNode>> implements EdgeC
}
/**
* Returns whether a forward edge connecting the source and destination nodes
* would be valid. Note that this method does not use the {@link EdgeIncluder}
* to decide validity.
* Returns whether a forward edge connecting the source and destination nodes would be valid. Note that this method
* does not use the {@link EdgeIncluder} to decide validity.
* <p>
* An edge is valid iff any of these two conditions is met:
* <ul>
......@@ -237,9 +221,8 @@ public class EdgeCreator extends Observable<Edge<ResourceNode>> implements EdgeC
}
/**
* Returns whether a backedge connecting the source and destination nodes would
* be valid. Note that this method does not use the internal
* {@link EdgeIncluder} to decide validity.
* Returns whether a backedge connecting the source and destination nodes would be valid. Note that this method does
* not use the internal {@link EdgeIncluder} to decide validity.
* <p>
* A backedge is valid iff any of these two conditions is met:
* <ul>
......@@ -268,8 +251,7 @@ public class EdgeCreator extends Observable<Edge<ResourceNode>> implements EdgeC
}
/**
* Computes the delay of a forward edge connecting the source node to the
* destination node.
* Computes the delay of a forward edge connecting the source node to the destination node.
*
* @param src the edge's source node
* @param dst the edge's destination node
......@@ -280,8 +262,7 @@ public class EdgeCreator extends Observable<Edge<ResourceNode>> implements EdgeC
}
/**
* Computes the delay of a backedge connecting the source node to the
* destination node.
* Computes the delay of a backedge connecting the source node to the destination node.
*
* @param src the backedge's source node
* @param dst the backedge's destination node
......@@ -292,8 +273,7 @@ public class EdgeCreator extends Observable<Edge<ResourceNode>> implements EdgeC
}
/**
* Computes the distance of a backedge connecting the source node to
* the destination node.
* Computes the distance of a backedge connecting the source node to the destination node.
*
* @param src the backedge's source node
* @param dst the backedge's destination node
......@@ -348,15 +328,12 @@ public class EdgeCreator extends Observable<Edge<ResourceNode>> implements EdgeC
}
/**
* Toggles strict mode, allowing or disallowing deviations of specified
* parameters.
* Toggles strict mode, allowing or disallowing deviations of specified parameters.
* <p>
* In strict mode, an edge can only be created if its delay matches a previously
* computed delay (via {@link #computeEdgeDelay(ResourceNode, ResourceNode)}).
* If this hasn't been done, the method will be called to obtain a 'previously'
* computed delay. If the delays differ, the edge creation will be disallowed,
* resulting in a {@link StrictModeException} being thrown. (analogously:
* distances and backedges).
* In strict mode, an edge can only be created if its delay matches a previously computed delay (via {@link
* #computeEdgeDelay(ResourceNode, ResourceNode)}). If this hasn't been done, the method will be called to obtain a
* 'previously' computed delay. If the delays differ, the edge creation will be disallowed, resulting in a {@link
* StrictModeException} being thrown. (analogously: distances and backedges).
*
* @param strict true to disallow deviations, false to allow deviations
*/
......@@ -383,8 +360,7 @@ public class EdgeCreator extends Observable<Edge<ResourceNode>> implements EdgeC
}
/**
* Returns an unmodifiable view of the set of the source node's outgoing forward
* edges.
* Returns an unmodifiable view of the set of the source node's outgoing forward edges.
*
* @param src the provided source node
* @return its outgoing forward edges
......@@ -404,8 +380,7 @@ public class EdgeCreator extends Observable<Edge<ResourceNode>> implements EdgeC
}
/**
* Returns an unmodifiable view of the set of the source node's outgoing