Example #1
0
        public void AddObject(SimulationObject ob)
        {
            lock (blackboardLock)
            {
                BBObjectInfo bbob = new BBObjectInfo(ob);
                if (objects.ContainsKey(bbob.id))
                {
                    throw new Exception("Blackboard:  Error, trying to add object that already exists!");
                }
                else
                {
                    objects[bbob.id] = bbob;
                }
            }

        }
Example #2
0
        static public SimulationObject BuildObject(ref SimulationModelInfo model, string objectType)
        {
            SimulationObject o = new SimulationObject();
            
            if (!model.objectModel.objects.ContainsKey(objectType))
            {
                throw new Exception("Object type doesn't exist");
            }

            foreach (AttributeInfo aInfo in model.objectModel.objects[objectType].attributes.Values)
            {
                o[aInfo.name] = DataValueFactory.BuildValue(aInfo.dataType);
            }
            o.objectType = objectType;

            return o;
        }
Example #3
0
        static public SimulationObject BuildObject(ref SimulationModelInfo model, string objectType)
        {
            SimulationObject o = new SimulationObject();

            if (!model.objectModel.objects.ContainsKey(objectType))
            {
                throw new Exception("Object type doesn't exist");
            }

            foreach (AttributeInfo aInfo in model.objectModel.objects[objectType].attributes.Values)
            {
                o[aInfo.name] = DataValueFactory.BuildValue(aInfo.dataType);
            }
            o.objectType = objectType;

            return(o);
        }
Example #4
0
 public BBObjectInfo(SimulationObject ob)
 {
     simObject = ob;
     id = ((StringValue)ob["ID"]).value;
 }