Пример #1
0
        /// <summary>
        /// Adds a timed vertex to the cache of the timed vertices
        /// </summary>
        /// <param name="T"></param>
        /// <param name="Vertex"></param>
        private void addToTimedVerticesCache(int T, TimedVertex <TIdentity> Vertex)
        {
            if (!_cachedTimeStepVertices.ContainsKey(T))
            {
                _cachedTimeStepVertices[T] = new List <Vertex <TIdentity> >();
            }

            _cachedTimeStepVertices[T].Add(Vertex);
        }
Пример #2
0
        /// <summary>
        /// Add a timed vertex to the graph.
        /// </summary>
        /// <param name="Vertex"></param>
        public void AddTimedVertex(TimedVertex <TIdentity> Vertex)
        {
            if (Vertex == null)
            {
                throw new ArgumentNullException("Vertex");
            }

            _timedVertices.Add(Vertex);
            for (int i = 0; i <= _maxTimeStep; i++)
            {
                if (Vertex.IsPresentAt(this, i))
                {
                    addToTimedVerticesCache(i, Vertex);
                }
            }

            recomputeVertexSet(_currentTimeStep);
        }