Class SequenceUtils


  • public class SequenceUtils
    extends Object
    Author:
    Data Mining Lab, Georgia State University
    • Constructor Detail

      • SequenceUtils

        public SequenceUtils()
    • Method Detail

      • generateHead

        public static Instance generateHead​(Instance ins,
                                            long headInterval)
        Generates head segment using head interval strategy Gets the trajectory segment that covers initial 'headInterval' time interval.
        Parameters:
        ins - - instance whose head is to be generated
        headInterval - - head interval parameter
        Returns:
        head segment of the instance which is a Trajectory object
      • generateHeadwithRatio

        public static Instance generateHeadwithRatio​(Instance ins,
                                                     double headRatio)
        Generates head segment using head ratio strategy Gets the trajectory segment that covers initial 'headRatio' amount of trajectory's lifespan.
        Parameters:
        ins -
        headRatio -
        Returns:
      • generateTail

        public static Trajectory generateTail​(Instance ins,
                                              long tailInterval)
        Generates the tail segment using tail interval strategy Gets the trajectory segment that covers last 'tailInterval' time interval.
        Parameters:
        ins - - instance whose head is to be generated
        tailInterval - - tail interval parameter
        Returns:
        tail segment of the trajectory
      • generateTail

        public static Trajectory generateTail​(Instance ins,
                                              float tailRatio)
        Generates tail segment using tail ratio strategy Gets the trajectory segment that covers last 'tailRatio' amount of trajectory's lifespan.
        Parameters:
        ins -
        tailRatio -
        Returns:
      • generateTailBuffer

        public static Trajectory generateTailBuffer​(Trajectory tail,
                                                    double bufferDistance)
        Generates tail buffer from a given tail segment of the trajectory using bufferDistance parameter. Simply applies a spatial buffer to all geometries
        Parameters:
        tail - - tail trajectory segment
        bufferDistance - - buffer distance parameter
        Returns:
      • generateTailWindow

        public static Trajectory generateTailWindow​(Trajectory tailBuffer,
                                                    long tailValidity,
                                                    long samplingInterval)
        Generates tail window using the buffered tail trajectory by propagating it
        Parameters:
        tailBuffer - - buffered tail trajectory
        tailValidity - - the period that will be used to propagate the tgpairs in trajectory
        samplingInterval - - the sampling interval for creating a better tail window
        Returns:
        - tail window trajectory
      • sampleTGPairs

        public static Trajectory sampleTGPairs​(Trajectory traj,
                                               long samplingInterval)
        Based on a sampling interval, sample the time-geometry pairs in the trajectory
        Parameters:
        traj -
        samplingInterval -
        Returns:
      • generateTailWindowWithRatio

        public static Instance generateTailWindowWithRatio​(Instance instance,
                                                           double tailRatio,
                                                           double bufferDistance,
                                                           long tailValidityCount)
      • generateTailWindow

        public static Instance generateTailWindow​(Instance instance,
                                                  long tailInterval,
                                                  double bufferDistance,
                                                  long tailValidityCount)
                                           throws org.locationtech.jts.io.ParseException
        Throws:
        org.locationtech.jts.io.ParseException
      • createTailWindow

        public static Trajectory createTailWindow​(Instance ins,
                                                  long tailInterval,
                                                  double bufferDistance,
                                                  long tailValidity,
                                                  long samplingInterval)
        Generates tail window from an instance
        Parameters:
        ins -
        tailInterval -
        bufferDistance -
        tailValidity -
        samplingInterval -
        Returns:
      • createTailWindow

        public static Trajectory createTailWindow​(Instance ins,
                                                  float tailRatio,
                                                  double bufferDistance,
                                                  long tailValidity,
                                                  long samplingInterval)
        Generates tail window from an instance
        Parameters:
        ins -
        tailRatio -
        bufferDistance -
        tailValidity -
        samplingInterval -
        Returns:
      • discoverFollowRelationship

        public static TwoSequence discoverFollowRelationship​(InstanceData headData,
                                                             Trajectory head,
                                                             InstanceData tailData,
                                                             Trajectory tailW,
                                                             String ciType)
        Given two instance trajectories in form of InstanceData objects and trajectories (head and tailWindow), method returns an TwoSequence (2-sequence) object, which describes a follow relationship
        Parameters:
        headData - - the data for head
        head - - head segment
        tailData - - the data for tail window
        tailW - - tail window segment
        ciType - - chain index type
        Returns:
      • instanceSequenceConnector

        public static Set<InstanceSequence> instanceSequenceConnector​(HashSet<InstanceSequence> instanceSequences,
                                                                      int desiredLength)
        Gets a set of instance sequences (InstanceSequence objects), and connects them based on the equality of prefix and suffix (of possible followee and follower instance sequences)
        Parameters:
        instanceSequences - - set of instance sequences to be examined
        desiredLength - - the length of resulting instance sequences
        Returns: