Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        //displayText2.text="Filtering is : " + filter +" labels are : ";//+ts.GetNbOfLabels() + "\t label is :" + ts.GetLabels().Length;
        displayText.text = " Labesl are : " + ts.GetNbOfLabels() + "\t labels are \t " + labelstoString(ts) + "\t" + "\t Likeliest is " + hhmm.GetLikeliest() + " filter is " + filter;   // ts.GetLabels().Length;
        //displayText2.text = " Likelihood is: " + gyroDelta[0] + "\t"+ gyroDelta[1] +"\t" + gyroDelta[2] ; //+"\t"+ hhmm.GetLikelihoods()[0] + "\t"+ hhmm.GetLikelihoods()[1] + "\t" + hhmm.GetLikeliest();
        displayText.text  = "";
        displayText2.text = "";

        if (hhmm.GetTimeProgressions()[1] > 0.95f && hhmm.GetTimeProgressions()[1] < 1.05f)
        {
            //filter = false;
            goLevelDesign.GetComponent <LevelDesignWords>().letter = ts.GetLabels()[1];

            //displayText3.text = "after clear()" + hhmm.GetTimeProgressions()[1] ;
        }
        else
        {
            displayText3.text = " ";
            //filter = true;
        }


        if (filter)
        {
            gyroDistanceThreshold = thresholds[dataStreamer.modeValue];                 //threshold as a function of the recording mode

            gyroCoords[0] = dataStreamer.data[0];
            gyroCoords[1] = dataStreamer.data[1];
            gyroCoords[2] = dataStreamer.data[2];

            if (distance(gyroCoords, prevGyroCoords) > gyroDistanceThreshold)
            {
                //not over the threshold
                displayText2.text = " Likelihood is: " + "\t" + likelihoodsString(ts);                  //+ distance(gyroCoords, prevGyroCoords) + "\t" + gyroCoords[0]+ "\t"+ prevGyroCoords[0] + "\t" + gyroDistanceThreshold;
                /*+ hhmm.GetTimeProgressions()[0] +  "\t" + hhmm.GetTimeProgressions()[1] */

                hhmm.Filter(gyroDelta);
                likeliest   = hhmm.GetLikeliest();
                likelihoods = hhmm.GetLikelihoods();

                prevGyroCoords[0] = gyroCoords[0]; //dataStreamer.data[0];
                prevGyroCoords[1] = gyroCoords[1]; //dataStreamer.data[1];
                prevGyroCoords[2] = gyroCoords[2]; //dataStreamer.data[2];
            }
            else                                   //filter if there s a motion

            {
                displayText3.text = "Please move ! ";
            }
        }
        else
        {
            displayText3.text = " ";
            //displayText3.text = " Not Filtering ! ";
            //goLevelDesign.GetComponent<LevelDesignWords>().letter = "" ;
        }
    }
Ejemplo n.º 2
0
    private string labelstoString(XmmTrainingSet ts)
    {
        string s = "";

        for (int i = 0; i < ts.GetLabels().Length; i++)
        {
            s += ts.GetLabels()[i] + "\t";
        }
        return(s);
    }
Ejemplo n.º 3
0
 private void logLabels()
 {
     string[] labels = ts.GetLabels();
     Debug.Log("nb of labels : " + labels.Length);
     for (int i = 0; i < labels.Length; ++i)
     {
         Debug.Log("label " + i + " : " + labels[i]);
     }
 }
Ejemplo n.º 4
0
    private string likelihoodsString(XmmTrainingSet ts)
    {
        string s = "";

        for (int i = 0; i < ts.GetLabels().Length; i++)
        {
            s += hhmm.GetTimeProgressions()[i] + "\t";
        }
        return(s);
    }