Пример #1
0
    /********************* Template methods *********************/
    void Awake()
    {
        Base   = GameObject.Find("Base");
        AxisB1 = GameObject.Find("AxisB1");
        AxisB2 = GameObject.Find("AxisB2");
        AxisC  = GameObject.Find("AxisC");
        AxisX  = GameObject.Find("AxisX");
        AxisY1 = GameObject.Find("AxisY1");
        AxisY2 = GameObject.Find("AxisY2");
        AxisZ  = GameObject.Find("AxisZ");
        Cutter = GameObject.Find("Cutter");

        Base.layer   = LayerMask.NameToLayer("Agent Entity");
        AxisB1.layer = LayerMask.NameToLayer("Agent Entity");
        AxisB2.layer = LayerMask.NameToLayer("Agent Entity");
        AxisC.layer  = LayerMask.NameToLayer("Agent Entity");
        AxisX.layer  = LayerMask.NameToLayer("Agent Entity");
        AxisY1.layer = LayerMask.NameToLayer("Agent Entity");
        AxisY2.layer = LayerMask.NameToLayer("Agent Entity");
        AxisZ.layer  = LayerMask.NameToLayer("Agent Entity");
        Cutter.layer = LayerMask.NameToLayer("Agent Entity");

        AxisB1.tag = "rotation";
        AxisB2.tag = "rotation";
        AxisC.tag  = "rotation";
        AxisX.tag  = "translation";
        AxisY1.tag = "translation";
        AxisY2.tag = "translation";
        AxisZ.tag  = "translation";
        Cutter.tag = "translation";

        axisB1 = AxisB1.transform;
        axisB2 = AxisB2.transform;
        axisC  = AxisC.transform;
        axisX  = AxisX.transform;
        axisY1 = AxisY1.transform;
        axisY2 = AxisY2.transform;
        axisZ  = AxisZ.transform;
        cutter = Cutter.transform;

        HandleAxis(AxisB2);
        HandleAxis(AxisC);
        HandleAxis(AxisY1);
        HandleAxis(AxisY2);
        HandleAxis(Cutter);

        sensorCamWidthTopView         = cameraSensorResolutionTopView[0];
        sensorCamHeightTopView        = cameraSensorResolutionTopView[1];
        sensorCamWidthTopViewInverse  = cameraSensorResolutionTopViewInverse[0];
        sensorCamHeightTopViewInverse = cameraSensorResolutionTopViewInverse[1];
        sensorCamWidthFrontView       = cameraSensorResolutionFrontView[0];
        sensorCamHeightFrontView      = cameraSensorResolutionFrontView[1];
        SetCameraSensor();

        DetectorAll    = GameObject.Find("DetectorAll");
        DetectorAxisY1 = GameObject.Find("DetectorAxisY1");
        DetectorAxisY2 = GameObject.Find("DetectorAxisY2");
        DetectorCutter = GameObject.Find("DetectorCutter");

        DetectorAxisY1.layer = LayerMask.NameToLayer("Detector");
        DetectorAxisY2.layer = LayerMask.NameToLayer("Detector");
        DetectorCutter.layer = LayerMask.NameToLayer("Detector");

        markersAxisY = GameObject.Find("MarkersAxisY").transform;

        MarkerAxisYIn  = GameObject.Find("MarkerAxisYIn");
        MarkerAxisYOut = GameObject.Find("MarkerAxisYOut");
        MarkerAxisYCollisionFrontIn  = GameObject.Find("MarkerAxisYCollisionFrontIn");
        MarkerAxisYCollisionFrontOut = GameObject.Find("MarkerAxisYCollisionFrontOut");
        MarkerAxisYCollisionTopIn    = GameObject.Find("MarkerAxisYCollisionTopIn");
        MarkerAxisYCollisionTopOut   = GameObject.Find("MarkerAxisYCollisionTopOut");

        MarkerAxisYIn.layer  = LayerMask.NameToLayer("MarkerFront");
        MarkerAxisYOut.layer = LayerMask.NameToLayer("MarkerFront");
        MarkerAxisYCollisionFrontIn.layer  = LayerMask.NameToLayer("MarkerFront");
        MarkerAxisYCollisionFrontOut.layer = LayerMask.NameToLayer("MarkerFront");
        MarkerAxisYCollisionTopIn.layer    = LayerMask.NameToLayer("MarkerTop");
        MarkerAxisYCollisionTopOut.layer   = LayerMask.NameToLayer("MarkerTop");

        markersCutter = GameObject.Find("MarkersCutter").transform;

        MarkerCutterIn  = GameObject.Find("MarkerCutterIn");
        MarkerCutterOut = GameObject.Find("MarkerCutterOut");
        MarkerCutterCollisionFrontIn  = GameObject.Find("MarkerCutterCollisionFrontIn");
        MarkerCutterCollisionFrontOut = GameObject.Find("MarkerCutterCollisionFrontOut");
        MarkerCutterCollisionTopIn    = GameObject.Find("MarkerCutterCollisionTopIn");
        MarkerCutterCollisionTopOut   = GameObject.Find("MarkerCutterCollisionTopOut");

        MarkerCutterIn.layer  = LayerMask.NameToLayer("MarkerFrontTop");
        MarkerCutterOut.layer = LayerMask.NameToLayer("MarkerFrontTop");
        MarkerCutterCollisionFrontIn.layer  = LayerMask.NameToLayer("MarkerFront");
        MarkerCutterCollisionFrontOut.layer = LayerMask.NameToLayer("MarkerFront");
        MarkerCutterCollisionTopIn.layer    = LayerMask.NameToLayer("MarkerTop");
        MarkerCutterCollisionTopOut.layer   = LayerMask.NameToLayer("MarkerTop");

        foreach (Transform marker in markersAxisY)
        {
            RenderEmissionComponent(marker.gameObject);
        }
        foreach (Transform marker in markersCutter)
        {
            RenderEmissionComponent(marker.gameObject);
        }

        AssistantTools = GameObject.Find("AssistantTools");

        EnvModeStr = EnvMode.ToString();

        ProModeTopViewStr = ProModeTopView.ToString();

        emissionIntensity = renderingDetails[0];
        lightIntensity    = renderingDetails[1];
        lightRange        = renderingDetails[2];
        transparency      = renderingDetails[3];

        if (emissionAgentComponent)
        {
            RenderEmissionComponent(Base);
            RenderEmissionComponent(AxisB1);
            RenderEmissionComponent(AxisB2);
            RenderEmissionComponent(AxisC);
            RenderEmissionComponent(AxisX);
            RenderEmissionComponent(AxisY1);
            RenderEmissionComponent(AxisY2);
            RenderEmissionComponent(AxisZ);
        }

        Controller_UI = GameObject.Find("Controller_UI");

        heuristic = gameObject.GetComponent <BehaviorParameters>().behaviorType == BehaviorType.HeuristicOnly;
        inference = gameObject.GetComponent <BehaviorParameters>().behaviorType == BehaviorType.InferenceOnly;

        this.maxStep = numEpisodeStepMax;
    }
Пример #2
0
 public void Update(EnvironmentMode mode)
 {
     rootWeb.AllProperties[PropertyName] = mode.ToString();
     rootWeb.Update();
 }