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 neighbourhood
    static org.javatuples.Pair<int[],​Coordinate[]> getWeightsFromComments​(java.lang.String[] comments)
    Gets the weights and neighbourhood of a rule from the comments

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • 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 rule
      neighbourhood - 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.