浏览代码

Probabilities are not altered for non-uniform datasets

In this case, all new entries are given 0 probability
/main
Steven Borkman 4 年前
当前提交
46daa1ef
共有 1 个文件被更改,包括 11 次插入5 次删除
  1. 16
      com.unity.perception/Editor/Randomization/VisualElements/Parameter/ParameterElement.cs

16
com.unity.perception/Editor/Randomization/VisualElements/Parameter/ParameterElement.cs


listView.style.flexGrow = 1.0f;
listView.style.height = new StyleLength(listView.itemHeight * 4);
var uniformToggle = template.Q<Toggle>("uniform");
VisualElement MakeItem()
{
return new CategoricalOptionElement(

{
optionsProperty.DeleteArrayElementAtIndex(i);
}
ResetProbabilities();
m_SerializedProperty.serializedObject.ApplyModifiedProperties();

break;
}
ResetProbabilities();
// New items probability will be 0, unless uniform toggle is true
probabilitiesProperty.GetArrayElementAtIndex(probabilitiesProperty.arraySize - 1).floatValue = 0;
if (uniformToggle.value)
ResetProbabilities();
m_SerializedProperty.serializedObject.ApplyModifiedProperties();
listView.itemsSource = categoricalParameter.probabilities;

{
var optionProperty = optionsProperty.GetArrayElementAtIndex(optionsIndex + i);
optionProperty.objectReferenceValue = categories[i];
probabilitiesProperty.GetArrayElementAtIndex(i).floatValue = 0;
ResetProbabilities();
if (uniformToggle.value)
ResetProbabilities();
m_SerializedProperty.serializedObject.ApplyModifiedProperties();
listView.itemsSource = categoricalParameter.probabilities;

evt.StopImmediatePropagation();
});
var uniformToggle = template.Q<Toggle>("uniform");
var uniformProperty = m_SerializedProperty.FindPropertyRelative("uniform");
uniformToggle.BindProperty(uniformProperty);

正在加载...
取消
保存