public float CleanArea(CleanableEntity area) { /* Get the suction rate and energy used depending on if we are in turbo mode */ var suctionRate = baseSuctionEfficiency; var energyConsumptionRate = baseSuctionEnergyConsumption; if (turbo) { Debug.LogWarning("Using Turbo setting"); suctionRate = maxSuctionEfficiency; energyConsumptionRate = maxSuctionEnergyConsumption; } /* Dirtiness level before cleaning */ var dirtCleaned = area.CleanArea(suctionRate, maxDirtPerSecond, minDirtPerSecond); Agent.PerformanceMeasure.AddSuction(dirtCleaned, energyConsumptionRate); Debug.Log("dirt cleaned" + dirtCleaned); return(dirtCleaned); }
/* NOTE: If we want to make the sensor more accurate we could factor in the Agent's * actuator's capability. But, this would increase the coupling between sensor and actuator */ public override void AddGameObject(GameObject g) { cleanableEntity = g.GetComponent <CleanableEntity>(); targetTransform = g.GetComponent <Transform>(); }