implement trend detection logic
LocationBasedServices/sumoc-backend/pipeline/head This commit looks good
LocationBasedServices/sumoc-backend/pipeline/head This commit looks good
- for now aimed to detect weekly trends in car distances, easily extendable to all other attributes of the statsm model - including test
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package SuMoC.backend.trenddetection.models;
|
||||
|
||||
import SuMoC.backend.trenddetection.enums.StatAttribute;
|
||||
import SuMoC.backend.user.models.User;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
@@ -77,4 +78,10 @@ public class WeeklyMobilityStats {
|
||||
|
||||
@Column(nullable = false)
|
||||
private Long sumMetersTaxi = 0L;
|
||||
|
||||
public Long getValueFor(StatAttribute attribute) {
|
||||
return switch (attribute) {
|
||||
case CAR_DISTANCE -> sumMetersCar;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user