コード例 #1
0
ファイル: InstanceLoader.cs プロジェクト: FlorianPRN/Mascaret
        //defaultParamter toRun = true
        public InstanceLoader(AgentPlateform agentPlateform, Environment environment, string filename, bool toRun)
        {
            relations = new List<Relation>();
            this.toRun = toRun;
            try
            {
                if (filename != "")
                {
                    this.environment = environment;
                    this.agentPlateform = agentPlateform;
                    this.model = this.environment.Model;

                    XDocument parser;
                    this.basedir = filename;

                    //parser = XDocument.Load(filename);
                    String s = MascaretApplication.Instance.readFlow(filename);
                    parser = XDocument.Parse(s);

                    _parseInstances(parser.Root);
                    _addRelations();
                }
                relations.Clear();
            }
            catch (FileLoadException)
            {
            }
        }
コード例 #2
0
        public virtual void parse(XElement root, bool loadAll)
        {
            XElement appliNode = root.Element("ApplicationParameters");
            XElement actnode   = root.Element("Actors");
            XElement orgNode   = root.Element("Organisations");

            {
                if (agentPlateform == null)
                {
                    this.VRComponentFactory.Log("Agent Plateform");
                    // Parametres par defaut de l'applie ....
                    string ressourceDir = "HTTPServerBaseDir";
                    agentPlateform = new AgentPlateform("localhost", 8080, ressourceDir, false);
                    agent          = new Agent(agentPlateform, "HTTPManager", null, "");
                    agent.addBehavior("SimpleCommunicationBehavior", 0.2, true);
                    agentPlateform.addAgent(agent);
                }
            }

            foreach (XElement child in root.Elements())
            {
                if (child.Name.LocalName == "Environment")
                {
                    string      envUrl = child.Attribute("url").Value;
                    Environment env    = parseEnvironment(envUrl, actnode, orgNode, loadAll);
                }
            }
        }
コード例 #3
0
ファイル: Agent.cs プロジェクト: FlorianPRN/Mascaret
 //default parameters KBName = "default"
 public Agent(AgentPlateform ap, string name, AgentClass agentclass, string KBName)
     : base(name, agentclass)
 {
     this.aid = new AID(name, ap.name, ap.PortNumber);
     this.plateform = ap;
     mailbox = new Mailbox();
     knowledgeBase = new KnowledgeBase(KBName);
     behaviorPlanner = new BehaviorPlanner(this);
     //behaviorRealizer = new BehaviorRealizer();
 }
コード例 #4
0
ファイル: Agent.cs プロジェクト: mbbarange/Mascaret
 //default parameters KBName = "default"
 public Agent(AgentPlateform ap, string name, AgentClass agentclass, string KBName)
     : base(name, agentclass)
 {
     this.aid       = new AID(name, ap.name, ap.PortNumber);
     this.plateform = ap;
     mailbox        = new Mailbox();
     knowledgeBase  = new KnowledgeBase(KBName);
     //behaviorPlanner = new BehaviorPlanner(this);
     //behaviorRealizer = new BehaviorRealizer();
     emotion = "joyStrong";
 }
コード例 #5
0
ファイル: InstanceLoader.cs プロジェクト: FlorianPRN/Mascaret
        //typedef KnowledgeBase* (*BaseInitFunc)();
        //int _id=0;
        public void parseInstances(AgentPlateform agentPlateform, Environment environment, string filename, bool toRun)
        {
            this.toRun = toRun;
            this.environment = environment;
            this.agentPlateform = agentPlateform;
            this.model = this.environment.Model;
            XDocument parser = null;
            this.basedir = filename;
            parser = XDocument.Load(filename);

            _parseInstances(parser.Root);
            _addRelations();
            relations.Clear();
        }
コード例 #6
0
 public EmbodiedAgent(AgentPlateform ap, string name, AgentClass agentclass)
     : base(ap, name, agentclass, "default")
 {
     body = new Body(this);
 }
コード例 #7
0
ファイル: VirtualHuman.cs プロジェクト: mbbarange/Mascaret
 //protected TTSChannel tc;
 //protected string textToSpeak ="";
 //System.Threading.Thread newThread;
 //SpeechData currentSD;
 public VirtualHuman(AgentPlateform ap, string name, AgentClass agentclass)
     : base(ap, name, agentclass)
 {
     System.Console.WriteLine("VIRTUAL HUMAN");
 }
コード例 #8
0
ファイル: EmbodiedAgent.cs プロジェクト: FlorianPRN/Mascaret
 public EmbodiedAgent(AgentPlateform ap, string name, AgentClass agentclass)
     : base(ap, name, agentclass, "default")
 {
     body = new Body(this);
 }
コード例 #9
0
        //protected TTSChannel tc;
        //protected string textToSpeak ="";
        //System.Threading.Thread newThread;
        //SpeechData currentSD;


        public VirtualHuman(AgentPlateform ap, string name, AgentClass agentclass)
            : base(ap, name, agentclass)
        {
            System.Console.WriteLine("VIRTUAL HUMAN");
        }
コード例 #10
0
        public virtual void parse(XElement root, bool loadAll)
        {
            XElement appliNode = root.Element("ApplicationParameters");
            XElement actnode = root.Element("Actors");
            XElement orgNode = root.Element("Organisations");

            {
                if (agentPlateform == null)
                {
                    this.VRComponentFactory.Log("Agent Plateform");
                    // Parametres par defaut de l'applie ....
                    string ressourceDir = "HTTPServerBaseDir";
                    agentPlateform = new AgentPlateform("localhost", 8080, ressourceDir, false);
                    agent = new Agent(agentPlateform, "HTTPManager", null, "");
                    agent.addBehavior("SimpleCommunicationBehavior", 0.2, true);
                    agentPlateform.addAgent(agent);
                }

            }

            foreach (XElement child in root.Elements())
            {

                if (child.Name.LocalName == "Environment")
                {
                    string envUrl = child.Attribute("url").Value;
                    Environment env = parseEnvironment(envUrl, actnode, orgNode, loadAll);
                }
            }
        }
コード例 #11
0
ファイル: VirtualHuman.cs プロジェクト: FlorianPRN/Mascaret
 public VirtualHuman(AgentPlateform ap, string name, AgentClass agentclass)
     : base(ap, name, agentclass)
 {
     System.Console.WriteLine("VIRTUAL HUMAN");
     dialogueManager = new ConversationalDialogueManager(this);
 }