Package worldBuilder

Class AttributeEngine


  • public class AttributeEngine
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean abort()
      fall back to the last committed values (only for changed maps)
      boolean autoPlacement​(boolean[] selected, double[] quotas, AttributeEngine.WhichMap whichmap)
      rule based resource placement for the selected points
      boolean commit()
      make the current values the fall-backs (in case of abort)
      boolean placement​(boolean[] selected, AttributeEngine.WhichMap whichmap, double value)
      update the MeshPoint attributes for every selected
      boolean placementRules​(java.lang.String ruleFile, java.lang.String[] classNames, AttributeEngine.WhichMap whichmap)
      instantiate an auto-placement engine for the desired resource
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AttributeEngine

        public AttributeEngine​(Map map)
    • Method Detail

      • placement

        public boolean placement​(boolean[] selected,
                                 AttributeEngine.WhichMap whichmap,
                                 double value)
        update the MeshPoint attributes for every selected
        Parameters:
        selected - array of per-MeshPoint booleans, True->selected
        whichmap - RAIN, MINERAL, FLORA< FAUNA
        value - new attribute value
      • placementRules

        public boolean placementRules​(java.lang.String ruleFile,
                                      java.lang.String[] classNames,
                                      AttributeEngine.WhichMap whichmap)
        instantiate an auto-placement engine for the desired resource
        Parameters:
        ruleFile - name of file containing placement rules
        classNames - names of the placement classes
        whichmap - MINERAL, FLORA, FAUNA
      • autoPlacement

        public boolean autoPlacement​(boolean[] selected,
                                     double[] quotas,
                                     AttributeEngine.WhichMap whichmap)
        rule based resource placement for the selected points
        Parameters:
        selected - per-point booleans for selected points
        quotas - fraction of points desired per class
        whichmap - MINERAL, FLORA, FAUNA
      • commit

        public boolean commit()
        make the current values the fall-backs (in case of abort)
      • abort

        public boolean abort()
        fall back to the last committed values (only for changed maps)