private void newIdaTask() { var thName = Thread.CurrentThread.Name; var wdir = Directory.GetParent(TclModelPath).FullName; var tclModelName = Path.GetFileName(TclModelPath); IDATaskData task = TheTracor.GetNewTask(); if (task == null) if (TheTracor.TraceFinished) { return; } else { Thread.Sleep(60000); newIdaTask(); } IDATaskResult result = new IDATaskResult(); var res = Utils.RunOps(task.Record, task.IM, wdir, OpsExePath, tclModelName, ref result.FailFlag, ref result.Disp, ref result.EndTime); if (!res) { Console.WriteLine($"ERROR Running OpenSees at Sa= {task.IM} for record= {task.Record}"); return; } var data = (RecordTraceData) TheTracor.SetNewResult(task, result); showResults(task.Record, data.n, task.IM, result.Disp, data.slope, data.slopeRat, data.clpsFlag, data.failureFlag, data.endTime, data.stage, thName); newIdaTask(); }
public override Object SetNewResult(IDATaskData task, IDATaskResult result) { var iRec = task.Record; var data = recDataDict[iRec]; data.saVec.Add(task.IM); data.n++; data.failureFlag = result.FailFlag; data.endTime = result.EndTime; data.dispVec.Add(result.Disp); data.slope = Math.Abs((data.saVec[data.n] - data.saVec[data.n1]) / (data.dispVec[data.n] - data.dispVec[data.n1])); if (data.n == 1) { data.initSlope = data.slope; } data.slopeRat = data.slope / data.initSlope; if (data.slopeRat < 0.2 || data.dispVec[data.n] > 0.1 || data.failureFlag == 1) { data.clpsFlag = 1; data.SaClps = task.IM; } else { data.clpsFlag = 0; data.SaNoClps = task.IM; data.n1 = data.n; } data.PrintSelf(); var numClpsd = 0.0; /*var numNonClps = 0.0; * foreach (var iData in recDataDict.Values) * { * if (iData.SaClps != 0 && iData.SaClps <= sa) * { * numClpsd++; * } * if (iData.SaNoClps >= sa) * { * numNonClps++; * } * } * clpsP = numClpsd / numRecs; * nonClpsP = numNonClps / numRecs; * if (nPnt > 1 && (clpsP >= 0.5 || nonClpsP >= 0.5)) * NextStep(); * else if (nonClpsP >= (numRecs - 1 + 0.0) / (numRecs)) * NextStep();*/ var numRcvd = 0; foreach (var iData in recDataDict.Values) { if (iData.n == nPnt) { numRcvd++; } if (iData.SaClps != 0 && iData.SaClps <= sa) { numClpsd++; } } if (numRcvd == numRecs) { clpsP = numClpsd / numRecs; NextStep(); } return(data); }
public abstract Object SetNewResult(IDATaskData task, IDATaskResult result);