Class RandomWalker.Builder<T extends SequenceElement>

    • Field Detail

      • walkLength

        protected int walkLength
      • seed

        protected long seed
      • alpha

        protected double alpha
    • Constructor Detail

      • Builder

        public Builder​(@NonNull
                       @NonNull IGraph<T,​?> graph)
        Builder constructor for RandomWalker
        Parameters:
        graph - source graph to be used for this walker
    • Method Detail

      • setWalkLength

        public RandomWalker.Builder<T> setWalkLength​(int walkLength)
        This method specifies output sequence (walk) length
        Parameters:
        walkLength -
        Returns:
      • setNoEdgeHandling

        public RandomWalker.Builder<T> setNoEdgeHandling​(@NonNull
                                                         @NonNull NoEdgeHandling handling)
        This method defines walker behavior when it gets to node which has no next nodes available Default value: RESTART_ON_DISCONNECTED
        Parameters:
        handling -
        Returns:
      • setSeed

        public RandomWalker.Builder<T> setSeed​(long seed)
        This method specifies random seed.
        Parameters:
        seed -
        Returns:
      • setWalkDirection

        public RandomWalker.Builder<T> setWalkDirection​(@NonNull
                                                        @NonNull WalkDirection direction)
        This method defines next hop selection within walk
        Parameters:
        direction -
        Returns:
      • setRestartProbability

        public RandomWalker.Builder<T> setRestartProbability​(double alpha)
        This method defines a chance for walk restart Good value would be somewhere between 0.03-0.07
        Parameters:
        alpha -
        Returns:
      • build

        public RandomWalker<T> build()
        This method builds RandomWalker instance
        Returns: