Ejemplo n.º 1
0
        /// <summary>
        /// A class for running E2C operations.
        /// </summary>
        /// <param name="script">The script to builds the graph.</param>
        public Session(string[] script = null)
        {
            var actors     = new Dictionary <string, Actor>();
            var analyser   = new Analyser(actors);
            var parser     = new Parser(actors, (string name) => new Actor(this, name, null));
            var visualizer = new Visualizer(actors);

            this.Init(actors, analyser, parser, visualizer, script);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Inits the session and brings all players together.
 /// </summary>
 /// <param name="actors">The actors to work with.</param>
 /// <param name="analyser">A instance of the analyser.</param>
 /// <param name="parser">A instance of the parser.</param>
 /// <param name="visualizer">A instance of the visualiser.</param>
 /// <param name="script">The string list of the graph to parse.</param>
 protected void Init(
     Dictionary <string, Actor> actors, Analyser analyser,
     Parser parser, Visualizer visualizer, string[] script)
 {
     this.Name       = Const.DEFAULT;
     this.analyser   = analyser;
     this.parser     = parser;
     this.visualizer = visualizer;
     this.result     = new Result();
     this.tracer     = null;
     this.end        = null;
     this.actors     = actors;
     this.Actor <Action <string, Output <object>, Output <object>, Output <object>, Output <object> > >(Const.SELF, this.process); // TODO: missing function.
     this.Actor <Action <object> >(Const.OUT, this.result.set);
     if (script != null)
     {
         this.ParseGraph(script);
     }
 }