Class StateSetup

  • public class StateSetup
    extends java.lang.Object
    Utility class to help construct a State

    StateSetup contains the data to share among QState objects and
    TreeState objects, namely the assignment of offsets to frames,
    the mapping of frame indexes to indexes in the QState,
    the mapping of frame indexes to daf and dafparent index in
    the TreeState,
    • Constructor Detail

      • StateSetup

        public StateSetup​(long cPtr,
                          boolean cMemoryOwn)
      • StateSetup

        public StateSetup()
        Creates an empty StateSetup
      • StateSetup

        public StateSetup​(int version,
                          StateStructure tree,
                          VectorStateDataPtr stateDatas)
        Creates a StateSetup from a StateStructure and a number of
        valid statedata.
        version - [in] the version of the StateSetup
        tree - [in]
        stateDatas - [in] a list of valid statedatas for this version
    • Method Detail

      • getCPtr

        public static long getCPtr​(StateSetup obj)
      • delete

        public void delete()
      • getOffset

        public int getOffset​(StateData data)
        The position in QState at which the configuration for frame
        is stored.
      • getCacheIdx

        public int getCacheIdx​(StateData data)
        Get the position in cache list where data is stored.
        data - [in] the data to look for.
        the id or a negative value if not found.
      • size

        public int size()
        The total number of doubles allocated by all valid
        state data in the StateSetup.
        the total number of allocated doubles
        Note: This number equals the length of the QState array.
      • getVersion

        public int getVersion()
        gets the version of the StateSetup
        the version of the state setup
      • getFrame

        public Frame getFrame​(int id)
        gets the frame with index idx
        id - [in] the unique id of the frame
        the frame with id id, else NULL
      • getChildListIdx

        public int getChildListIdx​(FrameCPtr parent)
        gets the index that maps a frame parent into
        all its daf children.
        parent - [in] the parent to the children list
        index into the childlist array in tree state
      • getMaxChildListIdx

        public int getMaxChildListIdx()
        gets the number of valid frames in the state setup
      • getDafs

        public FrameVector getDafs()
        gets the list of DAFs that are valid in this state setup
        list of DAFs
      • getDAFIdx

        public int getDAFIdx​(FrameCPtr daf)
        gets the index that maps a DAF into its
        position in the TreeState daf list
        daf - [in] the daf frame
        index into the TreeState daf list
      • getMaxDAFIdx

        public int getMaxDAFIdx()
        gets the nr of valid DAFs in the state setup
        nr of valid DAFs
      • getTree

        public StateStructure getTree()
        gets the state structure that the state setup is part
        state structure
      • getStateData

        public VectorStateDataPtr getStateData()
        gets all valid state data of the state setup.
        list of valid state datas
        Note: elements in the list is invalid if they are NULL
      • getCacheIdx

        public int getCacheIdx​(int id)
        Get the position in cache list where state data with id is stored.
        id - [in] state data id.
        the id or a negative value if not found.
      • getMaxCacheIdx

        public int getMaxCacheIdx()
        Get the maximum number of caches possible.
        number of caches.