Package it.unisa.diem.ai.torcs.model
Enum Class Label
- All Implemented Interfaces:
Serializable
,Comparable<Label>
,Constable
Enum che rappresenta le possibili etichette (azioni discrete) per un campione
Sample
.
Utilizzato per la classificazione supervisionata del comportamento di guida.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAccelerazione forteDecelerazione o guida neutraFrenata attivaSterzata a destra (steering negativo)Sterzata a sinistra (steering positivo)Retromarcia attiva -
Method Summary
Modifier and TypeMethodDescriptionstatic Label
fromAction
(Action action) Discretizza un'azione continua in una label simbolica, secondo priorità: Retromarcia (gear = -1 e accelerazione > 0) Frenata (brake > 0.1) Sterzata sinistra (steering >= 0.10) Sterzata destra (steering <= -0.10) Accelerazione (accelerate >= 0.9) Altrimenti: Decelerazionestatic Label
fromCode
(int code) Ricostruisce una label a partire dal suo codice numerico.int
getCode()
Restituisce il codice numerico associato alla label.toString()
Restituisce una stringa leggibile per la label.static Label
Returns the enum constant of this class with the specified name.static Label[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
GIRA_SINISTRA
Sterzata a sinistra (steering positivo) -
ACCELERA
Accelerazione forte -
GIRA_DESTRA
Sterzata a destra (steering negativo) -
FRENA
Frenata attiva -
RETROMARCIA
Retromarcia attiva -
DECELERAZIONE
Decelerazione o guida neutra
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getCode
public int getCode()Restituisce il codice numerico associato alla label.- Returns:
- codice intero
-
fromCode
Ricostruisce una label a partire dal suo codice numerico.- Parameters:
code
- codice intero- Returns:
Label
corrispondente- Throws:
IllegalArgumentException
- se il codice non è valido
-
fromAction
Discretizza un'azione continua in una label simbolica, secondo priorità:- Retromarcia (gear = -1 e accelerazione > 0)
- Frenata (brake > 0.1)
- Sterzata sinistra (steering >= 0.10)
- Sterzata destra (steering <= -0.10)
- Accelerazione (accelerate >= 0.9)
- Altrimenti: Decelerazione
-
toString
Restituisce una stringa leggibile per la label.
-