Enum Class Label

java.lang.Object
java.lang.Enum<Label>
it.unisa.diem.ai.torcs.model.Label
All Implemented Interfaces:
Serializable, Comparable<Label>, Constable

public enum Label extends Enum<Label>
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 Constants
    Enum Constant
    Description
    Accelerazione forte
    Decelerazione o guida neutra
    Frenata attiva
    Sterzata a destra (steering negativo)
    Sterzata a sinistra (steering positivo)
    Retromarcia attiva
  • Method Summary

    Modifier and Type
    Method
    Description
    static Label
    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
    static Label
    fromCode(int code)
    Ricostruisce una label a partire dal suo codice numerico.
    int
    Restituisce il codice numerico associato alla label.
    Restituisce una stringa leggibile per la label.
    static Label
    Returns the enum constant of this class with the specified name.
    static Label[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • GIRA_SINISTRA

      public static final Label GIRA_SINISTRA
      Sterzata a sinistra (steering positivo)
    • ACCELERA

      public static final Label ACCELERA
      Accelerazione forte
    • GIRA_DESTRA

      public static final Label GIRA_DESTRA
      Sterzata a destra (steering negativo)
    • FRENA

      public static final Label FRENA
      Frenata attiva
    • RETROMARCIA

      public static final Label RETROMARCIA
      Retromarcia attiva
    • DECELERAZIONE

      public static final Label DECELERAZIONE
      Decelerazione o guida neutra
  • Method Details

    • values

      public static Label[] 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

      public static Label valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getCode

      public int getCode()
      Restituisce il codice numerico associato alla label.
      Returns:
      codice intero
    • fromCode

      public static Label fromCode(int code)
      Ricostruisce una label a partire dal suo codice numerico.
      Parameters:
      code - codice intero
      Returns:
      Label corrispondente
      Throws:
      IllegalArgumentException - se il codice non è valido
    • fromAction

      public static Label fromAction(Action action)
      Discretizza un'azione continua in una label simbolica, secondo priorità:
      1. Retromarcia (gear = -1 e accelerazione > 0)
      2. Frenata (brake > 0.1)
      3. Sterzata sinistra (steering >= 0.10)
      4. Sterzata destra (steering <= -0.10)
      5. Accelerazione (accelerate >= 0.9)
      6. Altrimenti: Decelerazione
      Parameters:
      action - l'oggetto Action da discretizzare
      Returns:
      la Label corrispondente
    • toString

      public String toString()
      Restituisce una stringa leggibile per la label.
      Overrides:
      toString in class Enum<Label>
      Returns:
      descrizione in italiano dell'azione