Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/update models #30

Merged
merged 9 commits into from
Mar 15, 2024
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ bin/
### Mac OS ###
.DS_Store
timeline/.idea/copilot/

### Project Specific Files ###
**/resources/*.schema.json
50 changes: 49 additions & 1 deletion parser/src/main/kotlin/model/Records.kt
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,59 @@ data class Activity(
/**
* Type of activity detected.
*/
val type: String?,
val type: ActivityType = ActivityType.UNKNOWN_ACTIVITY_TYPE,
/**
* Value from 0 to 100 indicating the likelihood that the user is performing this activity.
* The larger the value, the more consistent the data used to perform the classification is with the detected activity.
* Multiple activities may have high confidence values. For example, the `ON_FOOT` may have a confidence of 100 while the `RUNNING` activity may have a confidence of 95. The sum of the confidences of all detected activities for a classification does not have to be <= 100 since some activities are not mutually exclusive (for example, you can be walking while in a bus) and some activities are hierarchical (`ON_FOOT` is a generalization of `WALKING` and `RUNNING`).
*/
val confidence: Int?,
)

/**
* Enum class for different types of activities detected by the device, used in [Activity.type].
*/
enum class ActivityType(val title: String, val extraColor: String) {
BOATING("Boating", "#01579b"),
CATCHING_POKEMON("Catching Pokémon", "#db4437"),
CYCLING("Cycling", "#4db6ac"),
FLYING("Flying", "#3f51b5"),
HIKING("Hiking", "#c2185b"),
HORSEBACK_RIDING("Horseback riding", "#4db6ac"),
IN_BUS("On a bus", "#01579b"),
IN_CABLECAR("In a cable car", "#01579b"),
IN_FERRY("On a ferry", "#01579b"),
IN_FUNICULAR("On a funicular", "#01579b"),
IN_GONDOLA_LIFT("In a gondola lift", "#01579b"),
IN_PASSENGER_VEHICLE("Driving", "#01579b"),
IN_SUBWAY("On the subway", "#01579b"),
IN_TAXI("In a taxi", "#01579b"),
IN_TRAIN("On a train", "#01579b"),
IN_TRAM("On a tram", "#01579b"),
IN_VEHICLE("In a vehicle", "#03a9f4"),
IN_WHEELCHAIR("By wheelchair", "#03a9f4"),
KAYAKING("Kayaking", "#4db6ac"),
KITESURFING("Kitesurfing", "#4db6ac"),
MOTORCYCLING("Motorcycling", "#01579b"),
ON_FOOT("On foot", "#c2185b"),
ON_BICYCLE("On a bicycle", "#4db6ac"),
PARAGLIDING("Paragliding", "#4db6ac"),
ROWING("Rowing", "#c2185b"),
RUNNING("Running", "#c2185b"),
SAILING("Sailing", "#4db6ac"),
SKATEBOARDING("Skateboarding", "#4db6ac"),
SKATING("Skating", "#4db6ac"),
SKIING("Skiing", "#4db6ac"),
SLEDDING("Sledding", "#4db6ac"),
SNOWBOARDING("Snowboarding", "#4db6ac"),
SNOWMOBILE("Snowmobiling", "#01579b"),
SNOWSHOEING("Snowshoeing", "#c2185b"),
STILL("Still", "#01579b"),
SURFING("Surfing", "#4db6ac"),
SWIMMING("Swimming", "#c2185b"),
TILTING("Tilting", "#01579b"),
UNKNOWN("Unknown", "#03a9f4"),
UNKNOWN_ACTIVITY_TYPE("Unknown Activity", "#03a9f4"),
WALKING("Walking", "#03a9f4"),
WALKING_NORDIC("Nordic walking", "#c2185b"),
}
Comment on lines +177 to +220
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2024-03-15 at 11 15 19 AM

New types had to be added to pass test.

Loading
Loading