Ejemplo n.º 1
0
        public bool Equals(AbstractEnvironmentType p)
        {
            // If parameter is null return false:
            return(p != null);

            // Return true if the fields match:
        }
Ejemplo n.º 2
0
        protected override bool GetInputs(IGH_DataAccess da)
        {
            agents      = new List <IQuelea>();
            emitters    = new List <AbstractEmitterType>();
            environment = new WorldEnvironmentType();
            // Then we need to access the input parameters individually.
            // When data cannot be extracted from a parameter, we should abort this
            // method.
            if (!da.GetDataList(nextInputIndex++, agents))
            {
                return(false);
            }
            if (!da.GetDataList(nextInputIndex++, emitters))
            {
                return(false);
            }
            da.GetData(nextInputIndex++, ref environment);

            // We should now validate the data and warn the user if invalid data is
            // supplied.
            if (agents.Count <= 0)
            {
                AddRuntimeMessage(GH_RuntimeMessageLevel.Error, RS.agentsCountErrorMessage);
                return(false);
            }
            if (emitters.Count <= 0)
            {
                AddRuntimeMessage(GH_RuntimeMessageLevel.Error, RS.emittersCountErrorMessage);
                return(false);
            }
            return(true);
        }
Ejemplo n.º 3
0
 public SystemType(SystemType system)
 {
     // private ISpatialCollection<AgentType> particles;
     queleaSettings = system.queleaSettings;
     emitters       = system.emitters;
     environment    = system.environment;
     Quelea         = UpdateDynamicSpatialDataStructure((IList <IQuelea>)system.Quelea.SpatialObjects);
 }
Ejemplo n.º 4
0
 public VehicleType(IVehicle v, Point3d emittionPt, Vector3d initialVelocity, AbstractEnvironmentType environment)
     : base(v, emittionPt, initialVelocity, environment)
 {
     WheelRadius = v.WheelRadius;
     Wheels      = new IWheel[2];
     Wheels[(int)WheelPositions.LeftRear]  = new Wheel(GetWheelPosition(BodySize, RS.HALF_PI), WheelRadius, 0);
     Wheels[(int)WheelPositions.RightRear] = new Wheel(GetWheelPosition(BodySize, -RS.HALF_PI), WheelRadius, 0);
 }
Ejemplo n.º 5
0
 public SystemType(List <IQuelea> queleaSettings, List <AbstractEmitterType> emitters, AbstractEnvironmentType environment)
 {
     timestep            = 0;
     nextIndex           = 0;
     this.queleaSettings = queleaSettings;
     this.emitters       = emitters;
     this.environment    = environment;
     Quelea = MakeDynamicSpatialDataStructure();//new SpatialCollectionAsBinLattice<IQuelea>(min, max, (int)(Number.Clamp((min.DistanceTo(max) / 5), 5, 25)));
 }
Ejemplo n.º 6
0
        public override bool Equals(object obj)
        {
            // If parameter is null return false.

            // If parameter cannot be cast to Point return false.
            AbstractEnvironmentType p = obj as AbstractEnvironmentType;

            return(p != null);

            // Return true if the fields match:
        }
Ejemplo n.º 7
0
 public AgentType(IAgent a, Point3d emittionPt, Vector3d initialVelocity, AbstractEnvironmentType environment)
     : base(a, emittionPt, initialVelocity, environment)
 {
     SteerAcceleration = a.SteerAcceleration;
     MaxSpeed          = a.MaxSpeed;
     MaxForce          = a.MaxForce;
     VisionRadius      = a.VisionRadius;
     VisionAngle       = a.VisionAngle;
     Lat = 0; //Util.Random.RandomDouble(0, RS.TWO_PI);
     Lon = 0; //Util.Random.RandomDouble(-RS.HALF_PI, RS.HALF_PI);
 }
Ejemplo n.º 8
0
 public SystemType(List <IQuelea> queleaSettings, List <AbstractEmitterType> emitters, AbstractEnvironmentType environment, SystemType system)
 {
     timestep = system.timestep;
     //nextIndex = system.nextIndex;
     this.queleaSettings = queleaSettings;
     this.emitters       = emitters;
     this.environment    = environment;
     //this.min = system.min;
     //this.max = system.max;
     this.Quelea = system.Quelea;
     Quelea      = UpdateDynamicSpatialDataStructure((IList <IQuelea>)system.Quelea.SpatialObjects);//new SpatialCollectionAsBinLattice<IQuelea>(min, max, (int)(Number.Clamp((min.DistanceTo(max) / 5), 5, 25)), (IList<IQuelea>)system.Quelea.SpatialObjects);
 }
Ejemplo n.º 9
0
 public ParticleType(IParticle p, Point3d emittionPt, Vector3d initialVelocity, AbstractEnvironmentType environment)
     : this(p.Up, p.Acceleration3D, p.Lifespan,
            p.Mass, p.BodySize, p.HistoryLength)
 {
     Environment       = environment;
     Position3D        = emittionPt;
     Position          = Environment.MapTo2D(emittionPt);
     Velocity3D        = initialVelocity;
     Velocity          = MapTo2D(Velocity3D);
     Acceleration      = MapTo2D(Acceleration3D);
     Orientation       = SetOrientation();
     Position3DHistory = new PositionHistoryAsCircularArray(HistoryLength);
     //Position3DHistory = new PositionHistoryAsDataTree(HistoryLength);
     Position3DHistory.Add(Position3D, false);
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Initializes a new instance of the EatBehaviorComponent class.
 /// </summary>
 protected AbstractEnvironmentalBehaviorComponent(string name, string nickname, string description,
                                                  Bitmap icon, string componentGuid)
     : base(name, nickname, description, icon, componentGuid)
 {
     environment = new AxisAlignedBoxEnvironmentType();
 }