Package application.model
Class CommentGenerator
java.lang.Object
application.model.CommentGenerator
public class CommentGenerator
extends java.lang.Object
Useful methods for generating comments to be placed in the RLE (multi-line rulestrings).
-
Constructor Summary
Constructors Constructor Description CommentGenerator()
-
Method Summary
Modifier and Type Method Description static java.util.ArrayList<java.lang.String>
generateFromWeights(int[] weights, Coordinate[] neighbourhood)
Generates comments from the provided weights and neighbourhoodstatic org.javatuples.Pair<int[],Coordinate[]>
getWeightsFromComments(java.lang.String[] comments)
Gets the weights and neighbourhood of a rule from the comments
-
Constructor Details
-
CommentGenerator
public CommentGenerator()
-
-
Method Details
-
generateFromWeights
public static java.util.ArrayList<java.lang.String> generateFromWeights(int[] weights, Coordinate[] neighbourhood)Generates comments from the provided weights and neighbourhood- Parameters:
weights
- The weights of the ruleneighbourhood
- The neighbourhood of the rule- Returns:
- Returns an arraylist containing the comments each starting with "#R"
-
getWeightsFromComments
public static org.javatuples.Pair<int[],Coordinate[]> getWeightsFromComments(java.lang.String[] comments)Gets the weights and neighbourhood of a rule from the comments- Parameters:
comments
- The comments from the RLE- Returns:
- A pair containing the weights and the neighbourhood.
-