Ejemplo n.º 1
0
        //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)
            {
            }
        }
Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 3
0
 //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();
 }
Ejemplo n.º 4
0
 //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";
 }
Ejemplo n.º 5
0
        //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();
        }
Ejemplo n.º 6
0
 public EmbodiedAgent(AgentPlateform ap, string name, AgentClass agentclass)
     : base(ap, name, agentclass, "default")
 {
     body = new Body(this);
 }
Ejemplo n.º 7
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");
 }
Ejemplo n.º 8
0
 public EmbodiedAgent(AgentPlateform ap, string name, AgentClass agentclass)
     : base(ap, name, agentclass, "default")
 {
     body = new Body(this);
 }
Ejemplo n.º 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");
        }
Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 11
0
 public VirtualHuman(AgentPlateform ap, string name, AgentClass agentclass)
     : base(ap, name, agentclass)
 {
     System.Console.WriteLine("VIRTUAL HUMAN");
     dialogueManager = new ConversationalDialogueManager(this);
 }