docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Class Match3Sensor

    Sensor for Match3 games. Can generate either vector, compressed visual, or uncompressed visual observations. Uses a GridValueProvider to determine the observation values.

    Inheritance
    object
    Match3Sensor
    Implements
    ISensor
    IDisposable
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.MLAgents.Integrations.Match3
    Assembly: solution.dll
    Syntax
    public class Match3Sensor : ISensor, IDisposable

    Constructors

    Name Description
    Match3Sensor(AbstractBoard, GridValueProvider, int, Match3ObservationType, string)

    Create a sensor for the GridValueProvider with the specified observation type.

    Methods

    Name Description
    CellTypeSensor(AbstractBoard, Match3ObservationType, string)

    Create a sensor that encodes the board cells as observations.

    Dispose()

    Clean up the owned Texture2D.

    GetBuiltInSensorType()

    Return the corresponding BuiltInSensorType for the sensor.

    GetCompressedObservation()

    Return a compressed representation of the observation. For small observations, this should generally not be implemented. However, compressing large observations (such as visual results) can significantly improve model training time.

    GetCompressionSpec()

    Return information on the compression type being used. If no compression is used, return Default().

    GetName()

    Get the name of the sensor. This is used to ensure deterministic sorting of the sensors on an Agent, so the naming must be consistent across all sensors and agents.

    GetObservationSpec()

    Returns a description of the observations that will be generated by the sensor. See ObservationSpec for more details, and helper methods to create one.

    Reset()

    Resets the internal state of the sensor. This is called at the end of an Agent's episode. Most implementations can leave this empty.

    SpecialTypeSensor(AbstractBoard, Match3ObservationType, string)

    Create a sensor that encodes the cell special types as observations. Returns null if the board's NumSpecialTypes is 0 (indicating the sensor isn't needed).

    Update()

    Update any internal state of the sensor. This is called once per each agent step.

    Write(ObservationWriter)

    Write the observation data directly to the ObservationWriter. Note that this (and GetCompressedObservation()) may be called multiple times per agent step, so should not mutate any internal state.

    Extension Methods

    SensorExtensions.ObservationSize(ISensor)
    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023