mirror of
https://github.com/13hannes11/bachelor_thesis.git
synced 2024-09-04 01:11:00 +02:00
improve detail of scoring functions
This commit is contained in:
@@ -26,7 +26,7 @@ package API {
|
|||||||
|
|
||||||
package Manager {
|
package Manager {
|
||||||
class RecommendationManager {
|
class RecommendationManager {
|
||||||
getRecommentdation(strategy : String, preferences : Preferences, current_configuration : Configuration) : Configuration
|
+ getRecommentdation(strategy : String, preferences : Preferences, current_configuration : Configuration) : Configuration
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,13 +42,13 @@ package Model{
|
|||||||
}
|
}
|
||||||
package PreferenceModel {
|
package PreferenceModel {
|
||||||
class Preferences {
|
class Preferences {
|
||||||
getAllUserPreferences() : List<UserPreferences>
|
+ getAllUserPreferences() : List<UserPreferences>
|
||||||
getAllRatingsByCode(code : String) : List<Ratings>
|
+ getAllRatingsByCode(code : String) : List<Ratings>
|
||||||
getRatingValue(code : String, user : String) : float
|
+ getRatingValue(code : String, user : String) : float
|
||||||
}
|
}
|
||||||
class UserPreference {
|
class UserPreference {
|
||||||
user : String
|
user : String
|
||||||
getAllRatings() : List<Rating>
|
+ getAllRatings() : List<Rating>
|
||||||
}
|
}
|
||||||
class Rating {
|
class Rating {
|
||||||
code : String
|
code : String
|
||||||
@@ -114,39 +114,41 @@ package Scoring {
|
|||||||
}
|
}
|
||||||
|
|
||||||
package Value {
|
package Value {
|
||||||
class ValueFunction
|
class ValueToValueFunction
|
||||||
class Threshold
|
class Threshold
|
||||||
}
|
}
|
||||||
|
|
||||||
package RatingConverter {
|
package RatingConverter {
|
||||||
class RatingToListConverter
|
class PreferenceToListFunction
|
||||||
class FlatToListConverter
|
class FlatToListConverter
|
||||||
class PerUserToListConverter
|
class PerUserToListConverter
|
||||||
class PerFeatureToListConverter
|
class PerFeatureToListConverter
|
||||||
}
|
}
|
||||||
|
class ScoringFunction {
|
||||||
class ScoringFunctionFactory{
|
+ calc_score(currentConfiguration : Configuration, preferences : Preferences, toRate : ConfigurationModel) : float
|
||||||
|
|
||||||
}
|
}
|
||||||
ScoringFunctionFactory --> PreferenceScoringFunction : builds
|
class ScoringFunctionFactory{
|
||||||
|
+ build_scoring_function(params : List<String>) : ScoringFunction
|
||||||
|
}
|
||||||
|
ScoringFunctionFactory --> ScoringFunction : builds
|
||||||
|
|
||||||
|
|
||||||
PreferenceScoringFunction --> "1" RatingToListConverter : Stage 1
|
PreferenceScoringFunction --> "1" PreferenceToListFunction : preferenceToListFunction
|
||||||
PreferenceScoringFunction --> "0..*" ListToListFunction : Stage 2
|
PreferenceScoringFunction --> "0..*" ListToListFunction : listToListFunctions
|
||||||
PreferenceScoringFunction --> "1" ListToValueFunction : Stage 3
|
PreferenceScoringFunction --> "1" ListToValueFunction : listToValueFunction
|
||||||
PreferenceScoringFunction --> "0..*" ValueFunction : Stage 4
|
PreferenceScoringFunction --> "0..*" ValueToValueFunction : valueToValues
|
||||||
|
|
||||||
ScoringFunction <|-- PreferenceScoringFunction
|
ScoringFunction <|-- PreferenceScoringFunction
|
||||||
class PreferenceScoringFunction{
|
class PreferenceScoringFunction{
|
||||||
|
+ calc_score(currentConfiguration : Configuration, preferences : Preferences, toRate : ConfigurationModel) : float
|
||||||
}
|
}
|
||||||
ScoringFunction <|-- ConfigurationPenealty
|
ScoringFunction <|-- ConfigurationPenealty
|
||||||
abstract class ConfigurationPenealty{
|
abstract class ConfigurationPenealty{
|
||||||
|
+ ConfigurationPenealty(product_Structure : ProductStructure)
|
||||||
}
|
}
|
||||||
ConfigurationPenealty <|-- RatioConfigurationPenalty
|
ConfigurationPenealty <|-- RatioConfigurationPenalty
|
||||||
class RatioConfigurationPenalty {
|
class RatioConfigurationPenalty {
|
||||||
|
+ calc_score(currentConfiguration : Configuration, preferences : Preferences, toRate : ConfigurationModel) : float
|
||||||
}
|
}
|
||||||
ConfigurationPenealty <|-- PreferenceWeightedConfigurationPenalty
|
ConfigurationPenealty <|-- PreferenceWeightedConfigurationPenalty
|
||||||
ListToValueFunction --* "1" PreferenceWeightedConfigurationPenalty
|
ListToValueFunction --* "1" PreferenceWeightedConfigurationPenalty
|
||||||
@@ -155,67 +157,74 @@ package Scoring {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ScoringFunction <|-- ReduceScoringFunction
|
ScoringFunction <|-- ReduceScoringFunction
|
||||||
ReduceScoringFunction --* "2..*" ScoringFunction
|
ReduceScoringFunction *-- "2..*" ScoringFunction
|
||||||
class ReduceScoringFunction{
|
class ReduceScoringFunction{
|
||||||
|
reduce_operator : Operator
|
||||||
|
+ ReduceScoringFunction(scoringFunctions : List<ScoringFunction>, reduceOperator : Operator)
|
||||||
|
+ calc_score(currentConfiguration : Configuration, preferences : Preferences, toRate : ConfigurationModel) : float
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class RatingToListConverter {
|
interface PreferenceToListFunction {
|
||||||
|
+ convertToList(preferences : Preferences, toRate : Configuration) : List<float>:
|
||||||
}
|
}
|
||||||
|
|
||||||
RatingToListConverter <|-- PerFeatureToListConverter
|
PreferenceToListFunction <|-- PerFeatureToListConverter
|
||||||
PerFeatureToListConverter --> ListToValueFunction :uses
|
PerFeatureToListConverter --> ListToValueFunction :uses
|
||||||
class PerFeatureToListConverter {
|
class PerFeatureToListConverter {
|
||||||
|
+ PerFeatureToListConverter(listToValueFunction : ListToValueFunction)
|
||||||
|
+ convertToList(preferences : Preferences, toRate : Configuration) : List<float>:
|
||||||
}
|
}
|
||||||
RatingToListConverter <|-- PerUserToListConverter
|
PreferenceToListFunction <|-- PerUserToListConverter
|
||||||
PerUserToListConverter --> ListToValueFunction :uses
|
PerUserToListConverter --> ListToValueFunction :uses
|
||||||
class PerUserToListConverter {
|
class PerUserToListConverter {
|
||||||
|
+ PerUserToListConverter(listToValueFunction : ListToValueFunction)
|
||||||
|
+ convertToList(preferences : Preferences, toRate : Configuration) : List<float>:
|
||||||
}
|
}
|
||||||
RatingToListConverter <|-- FlatToListConverter
|
PreferenceToListFunction <|-- FlatToListConverter
|
||||||
class FlatToListConverter {
|
class FlatToListConverter {
|
||||||
|
+ convertToList(preferences : Preferences, toRate : Configuration) : List<float>:
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class ListFunction {
|
interface ListFunction {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ListFunction <|-- ListToListFunction
|
ListFunction <|-- ListToListFunction
|
||||||
abstract class ListToListFunction {
|
abstract class ListToListFunction {
|
||||||
|
+ {abstract} applyToList(list : List[float]) : List[float]
|
||||||
}
|
}
|
||||||
|
|
||||||
ListToListFunction <|-- ForEachValue
|
ListToListFunction <|-- ForEachValue
|
||||||
ForEachValue --> ValueFunction:uses
|
ForEachValue --> ValueToValueFunction:uses
|
||||||
class ForEachValue {
|
class ForEachValue {
|
||||||
|
+ FoEachValue(valueFunction : ValueToValueFunction)
|
||||||
|
+ applyToList(list : List[float]) : List[float]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ListFunction <|-- ListToValueFunction
|
ListFunction <|-- ListToValueFunction
|
||||||
abstract class ListToValueFunction {
|
abstract class ListToValueFunction {
|
||||||
|
+ {abstract} convertToFloat(list : List<float>) : float
|
||||||
}
|
}
|
||||||
|
|
||||||
ListToValueFunction <|-- Average
|
ListToValueFunction <|-- Average
|
||||||
class Average {
|
class Average {
|
||||||
|
+ convertToFloat(list : List<float>) : float
|
||||||
}
|
}
|
||||||
ListToValueFunction <|-- Product
|
ListToValueFunction <|-- Product
|
||||||
class Product {
|
class Product {
|
||||||
|
+ convertToFloat(list : List<float>) : float
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class ValueFunction{
|
interface ValueToValueFunction{
|
||||||
|
+ applyToValue(value : float) : float
|
||||||
}
|
}
|
||||||
|
|
||||||
ValueFunction <|-- Threshold
|
ValueToValueFunction <|-- Threshold
|
||||||
class Threshold {
|
class Threshold {
|
||||||
|
- threshold : float
|
||||||
|
+ Threshold(threshold : float)
|
||||||
|
+ applyToValue(value : float) : float
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user