Class Flow


  • public class Flow
    extends java.lang.Object
    Class representing flows through the network.
    • Field Detail

      • NULL_FLOW

        public static final Flow NULL_FLOW
      • id

        private int id
        The flow's ID.
      • arrival_curve

        private ArrivalCurve arrival_curve
        The flow's arrival curve
      • alias

        private java.lang.String alias
      • path

        private Path path
        The turn path the flow traverses incl explicit sink
    • Constructor Detail

      • Flow

        protected Flow​(int id,
                       java.lang.String alias,
                       ArrivalCurve ac,
                       Path path)
        Parameters:
        id - The flow's id (unique).
        alias - The flow's alias (not necessarily unique).
        ac - The flow's arrival curve.
        path - The turn path the flow traverses.
      • Flow

        private Flow()
    • Method Detail

      • createDummyFlow

        public static Flow createDummyFlow​(java.lang.String alias,
                                           ArrivalCurve ac,
                                           Path path)
        Creates a dummy flow with an arrival curve.
        All dummy flows share the same id -1.
        Parameters:
        alias - The flow's alias (not necessarily unique).
        ac - The flow's arrival curve.
        path - The turn path the flow traverses.
        Returns:
        a dummy flow
      • setArrivalCurve

        public boolean setArrivalCurve​(ArrivalCurve arrival_curve)
      • getArrivalCurve

        public ArrivalCurve getArrivalCurve()
        Returns:
        A copy of the arrival curve
      • getId

        public int getId()
      • getAlias

        public java.lang.String getAlias()
      • setAlias

        public void setAlias​(java.lang.String alias)
      • getPath

        public Path getPath()
      • commonStringPrefix

        private java.lang.StringBuffer commonStringPrefix()
      • toShortString

        public java.lang.String toShortString()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        String representation of the flow.
      • toLongString

        public java.lang.String toLongString()
      • getSource

        public Server getSource()
      • getSink

        public Server getSink()
      • getServersOnPath

        public java.util.LinkedList<Server> getServersOnPath()
      • getTurnsOnPath

        public java.util.List<Turn> getTurnsOnPath()
                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getSubPath

        public Path getSubPath​(Server from,
                               Server to)
                        throws java.lang.Exception
        Parameters:
        from - Source, inclusive.
        to - Sink, inclusive.
        Returns:
        The subpath.
        Throws:
        java.lang.Exception - No subpath found; most probably an input parameter problem.
      • getPrecedingTurn

        public Turn getPrecedingTurn​(Server s)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getSucceedingTurn

        public Turn getSucceedingTurn​(Server s)
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getPrecedingServer

        public Server getPrecedingServer​(Server s)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getSucceedingServer

        public Server getSucceedingServer​(Server s)
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception