<commit_before>/*
The OpenTRV project licenses this file to you
under the Apache Licence, Version 2.0 (the "Licence");
you may not use this file except in compliance
with the Licence. You may obtain a copy of the Licence at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the Licence is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the Licence for the
specific language governing permissions and limitations
under the Licence.

Author(s) / Copyright (s): <NAME> 2013--2016
*/

/*
 Occupancy pseudo-sensor that combines inputs from other sensors.
 */

#ifndef OTV0P2BASE_SENSOROCCUPANCY_H
#define OTV0P2BASE_SENSOROCCUPANCY_H

#include "OTV0P2BASE_Concurrency.h"
#include "OTV0P2BASE_Sensor.h"


namespace OTV0P2BASE
{


// Pseudo-sensor collating inputs from other primary sensors to estimate active room occupancy by humans.
// This measure of occupancy is not intended to include people asleep
// (or pets, for example).
// 'Sensor' value is % confidence that the room/area controlled by this unit
// has active human occupants.
// Occupancy is also available as more simple
// 3 (likely), 2 (possibly), 1 (not), 0 (unknown) scale.
// The model is relatively simple based on time since
// last likely/possibly indication.
class PseudoSensorOccupancyTracker final : public OTV0P2BASE::SimpleTSUint8Sensor
  {
  public:
    // Number of minutes that room is regarded as occupied after markAsOccupied() in range [4,200].
    // No activity for ~30 minutes usually enough to declare room empty;
    // an hour or more would be conservative.<commit_msg>fixed compilation<commit_after>/*
The OpenTRV project licenses this file to you
under the Apache Licence, Version 2.0 (the "Licence");
you may not use this file except in compliance
with the Licence. You may obtain a copy of the Licence at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the Licence is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the Licence for the
specific language governing permissions and limitations
under the Licence.

Author(s) / Copyright (s): <NAME> 2013--2016
*/

/*
 Occupancy pseudo-sensor that combines inputs from other sensors.
 */

#ifndef OTV0P2BASE_SENSOROCCUPANCY_H
#define OTV0P2BASE_SENSOROCCUPANCY_H

#include "OTV0P2BASE_Concurrency.h"
#include "OTV0P2BASE_Util.h"
#include "OTV0P2BASE_Sensor.h"


namespace OTV0P2BASE
{


// Pseudo-sensor collating inputs from other primary sensors to estimate active room occupancy by humans.
// This measure of occupancy is not intended to include people asleep
// (or pets, for example).
// 'Sensor' value is % confidence that the room/area controlled by this unit
// has active human occupants.
// Occupancy is also available as more simple
// 3 (likely), 2 (possibly), 1 (not), 0 (unknown) scale.
// The model is relatively simple based on time since
// last likely/possibly indication.
class PseudoSensorOccupancyTracker final : public OTV0P2BASE::SimpleTSUint8Sensor
  {
  public:
    // Number of minutes that room is regarded as occupied after markAsOccupied() in range [4,200].
    // No activity for ~30 minutes usually enough to declare room empty;
    // an hour or more would be conservative.
{'fraction_non_alphanumeric': 0.07174103237095363, 'fraction_numerical': 0.02099737532808399, 'mean_word_length': 4.268817204301075, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4329427', 'n_tokens_mistral': 1014, 'n_tokens_neox': 957, 'n_words': 440}