/// <summary>
        ///   Initializes a new instance.
        /// </summary>
        /// <param name="stateGraph">The state graph that should be analyzed.</param>
        /// <param name="successorStateCapacity">The maximum number of successor states supported per state.</param>
        public StateGraphModel(StateGraph <TExecutableModel> stateGraph, long successorStateCapacity)
        {
            Requires.NotNull(stateGraph, nameof(stateGraph));

            _stateGraph  = stateGraph;
            _transitions = new StateGraphTransitionSetBuilder(StateVectorSize, successorStateCapacity);
        }
        /// <summary>
        ///   Initializes a new instance.
        /// </summary>
        /// <param name="createModel">Creates the model that should be checked.</param>
        /// <param name="output">The callback that should be used to output messages.</param>
        /// <param name="configuration">The analysis configuration that should be used.</param>
        internal StateGraphGenerator(AnalysisModelCreator <TExecutableModel> createModel,
                                     Action <string> output, AnalysisConfiguration configuration)
            : base(createModel, output, configuration, DeriveTransitionSizeFromModel)
        {
            var analyzedModel = AnalyzedModels.First();

            _stateGraph = new StateGraph <TExecutableModel>(
                Context, analyzedModel.TransitionSize,
                analyzedModel.RuntimeModel, analyzedModel.RuntimeModelCreator);

            Context.TraversalParameters.BatchedTransitionActions.Add(() => new StateGraphBuilder <TExecutableModel>(_stateGraph));
        }
Пример #3
0
        /// <summary>
        ///   Initializes a new instance.
        /// </summary>
        /// <param name="createModel">Creates the model that should be checked.</param>
        /// <param name="configuration">The analysis configuration that should be used.</param>
        internal StateGraphGenerator(AnalysisModelCreator createModel,
                                     AnalysisConfiguration configuration)
        {
            _modelTraverser = new ModelTraverser(createModel, configuration, ModelTraverser.DeriveTransitionSizeFromModel, false);

            var analyzedModel = _modelTraverser.AnalyzedModels.OfType <ExecutedModel <TExecutableModel> >().First();

            _stateGraph = new StateGraph <TExecutableModel>(
                _modelTraverser.Context, analyzedModel.TransitionSize,
                analyzedModel.RuntimeModel, analyzedModel.RuntimeModelCreator);

            _modelTraverser.Context.TraversalParameters.BatchedTransitionActions.Add(() => new StateGraphBuilder <TExecutableModel>(_stateGraph));
        }
Пример #4
0
 /// <summary>
 ///   Initializes a new instance.
 /// </summary>
 /// <param name="stateGraph">The state graph that should be built up.</param>
 public StateGraphBuilder(StateGraph <TExecutableModel> stateGraph)
 {
     Requires.NotNull(stateGraph, nameof(stateGraph));
     _stateGraph = stateGraph;
 }