module("EseDTWClassifier", package.seeall) -- Behavior function OnEntitySetFinished(selfID, strm) print("Begnning Classification Cycle"); local newStrm = DataStream.DataStream(); BehaviorAPI.SendEvent(selfID, "BeginCycle", nil); end -- Behavior function BeginCycle(selfID, strm) local x = BehaviorAPI.GetProperty(selfID, "Label"); if x <= 10 then local outStrm = DataStream.DataStream(); outStrm:PutUInt32(x); BehaviorAPI.SendEvent(selfID, "OnBeginClassify", outStrm); BehaviorAPI.SendEvent(selfID, "OnEndClassify", nil, nil, 2.0); BehaviorAPI.SendEvent(selfID, "OnGetClassification", nil, nil, 2.01); x = x + 1; BehaviorAPI.SetProperty(selfID, "Label", x); BehaviorAPI.SendEvent(selfID, "BeginCycle", nil, nil, 2.02); else BehaviorAPI.SendEvent(selfID, "OnSerialize", nil); end end