public void ResetSimulation()
        {
            if (_hs == null || _recurrenceVector == null)
            {
                throw new Exception("Cannot reset simulation because it has not yet been initialized.");
            }

            _totalStepCount             = 0;
            _currentStep                = (IHSExplicitVectorValue <HSEdgeState>)(IHSExplicitVector <HSEdgeState> .ZeroVector(_hs) + __qwGetStartVector(IQGVertex.StartVertex));
            this.CurrentSimulationState = new QwasiEvaluationState(_currentStep, _totalStepCount);

            this.RaiseSimulationStartedEvent(new QwasiSimulationStepEventArgs(this.CurrentSimulationState, 0, _totalStepCount));
            this.ApplySimulationGraphVisualizations();
        }
        public QwasiAnalyticsData CompileAnalytics(int stepInterval, int stepRangeStart, int stepRangeEnd)
        {
            if (stepRangeEnd < stepRangeStart)
            {
                return(new QwasiAnalyticsData());
            }

            __initializeMath();
            _currentStep = (IHSExplicitVectorValue <HSEdgeState>)(IHSExplicitVector <HSEdgeState> .ZeroVector(_hs) + __qwGetStartVector(IQGVertex.StartVertex));
            QwasiAnalyticsData analyticsData = new QwasiAnalyticsData()
            {
                StepInterval = stepInterval, MaxStepValue = 0
            };
            QwasiEvaluationState currentState = new QwasiEvaluationState(__performStepOperation(stepRangeStart), stepRangeStart);

            analyticsData.StateEvaluationList.Add(currentState);

            int stepCount;

            for (stepCount = stepRangeStart; stepCount + stepInterval <= stepRangeEnd; stepCount += stepInterval)
            {
                currentState = new QwasiEvaluationState(__performStepOperation(stepInterval), stepCount + stepInterval);
                analyticsData.StateEvaluationList.Add(currentState);
            }
            analyticsData.MaxStepValue = stepCount;

            List <QGEdge> updatedEdges = new List <QGEdge>();

            foreach (HSEdgeState edgeState in analyticsData.BasisStates)
            {
                QGEdge edge = edgeState.Vertex1.GetEdge(edgeState.Vertex2);
                if (updatedEdges.Contains(edge))
                {
                    continue;
                }

                this.AnalyticsEdgeLabels[edge].LoadAnalyticsData(analyticsData);

                updatedEdges.Add(edge);
            }

            this.CurrentAnalyticsData = analyticsData;
            this.RaiseAnalyticsDataCompiledEvent(new QwasiAnalyticsEventArgs(analyticsData));

            return(analyticsData);
        }