public class StateVariableRecorder extends BaseRecorder<StateVariableRecorder.StateRecord> implements IDStabSimuOutputHandler
Modifier and Type | Class and Description |
---|---|
static class |
StateVariableRecorder.StateRecord
data record for storing state in the dynamic simulation process.
|
static class |
StateVariableRecorder.StateVarRecType |
recordList, timeTolerance
Constructor and Description |
---|
StateVariableRecorder(double timeTolerance) |
Modifier and Type | Method and Description |
---|---|
void |
addCacheRecords(java.lang.String id,
StateVariableRecorder.StateVarRecType type,
java.lang.String vname,
double timeStep,
int points)
Add a set of time points and expected values for testing purpose.
|
void |
addTestRecords(java.lang.String id,
StateVariableRecorder.StateVarRecType type,
java.lang.String vname,
double[] tPoints,
double[] expectedValues)
Add a set of time points and expected values for testing purpose.
|
boolean |
close()
Will be called after the simulation for scripted output
|
double |
diffTotal(java.lang.String id,
StateVariableRecorder.StateVarRecType type,
java.lang.String vname)
Compare the seeded variable value with the measured
|
java.util.List<StateVariableRecorder.StateRecord> |
getBusRecords(java.lang.String busId,
StateVariableRecorder.StateVarRecType type,
java.lang.String vname)
get bus record
|
java.util.List<StateVariableRecorder.StateRecord> |
getMachineRecords(java.lang.String machId,
StateVariableRecorder.StateVarRecType type,
java.lang.String vname)
Get machine state records
|
java.util.List<java.lang.String> |
getOutputVarIdList()
get output var id list
|
boolean |
init(java.lang.String scriptFilename,
BaseDStabNetwork<?,?> net)
Init with the script file name for scripted output
|
static boolean |
isBusRec(StateVariableRecorder.StateVarRecType type)
check the var type is a bus state record
|
static boolean |
isMachineRec(StateVariableRecorder.StateVarRecType type)
check if the var type is a machine state record
|
boolean |
isOutputFilter()
Check if there is an output variable filter
|
boolean |
onMsgEventStatus(IpssMessage event)
Record the simulation results
|
void |
setOutputFilter(boolean b)
Set output filter status
|
void |
setOutputVarIdList(java.lang.String[] list)
Set output var id list
|
static java.lang.String |
type2String(StateVariableRecorder.StateVarRecType type)
function to convert state var record type to string
|
addTestRecord, onMsgEvent, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
onMsgEvent
public void addTestRecords(java.lang.String id, StateVariableRecorder.StateVarRecType type, java.lang.String vname, double[] tPoints, double[] expectedValues)
id
- id of time simulation record, for example, "Mach@0001"type
- vname
- state vartable name, for example, DStabOutSymbol.OUT_SYMBOL_MACH_ANGtPoints
- expectedValues
- public void addCacheRecords(java.lang.String id, StateVariableRecorder.StateVarRecType type, java.lang.String vname, double timeStep, int points)
id
- type
- vname
- timeStep
- points
- public java.util.List<StateVariableRecorder.StateRecord> getMachineRecords(java.lang.String machId, StateVariableRecorder.StateVarRecType type, java.lang.String vname)
machId
- type
- vname
- public java.util.List<StateVariableRecorder.StateRecord> getBusRecords(java.lang.String busId, StateVariableRecorder.StateVarRecType type, java.lang.String vname)
busId
- type
- vname
- public boolean onMsgEventStatus(IpssMessage event)
onMsgEventStatus
in interface IpssMsgListener
onMsgEventStatus
in class BaseRecorder<StateVariableRecorder.StateRecord>
event
- msgpublic double diffTotal(java.lang.String id, StateVariableRecorder.StateVarRecType type, java.lang.String vname)
id
- machine or bus idtype
- state variable typevname
- state variable namepublic static java.lang.String type2String(StateVariableRecorder.StateVarRecType type)
type
- public static boolean isMachineRec(StateVariableRecorder.StateVarRecType type)
type
- public static boolean isBusRec(StateVariableRecorder.StateVarRecType type)
type
- public boolean close()
IDStabSimuOutputHandler
close
in interface IDStabSimuOutputHandler
public boolean init(java.lang.String scriptFilename, BaseDStabNetwork<?,?> net)
IDStabSimuOutputHandler
init
in interface IDStabSimuOutputHandler
public java.util.List<java.lang.String> getOutputVarIdList()
IDStabSimuOutputHandler
getOutputVarIdList
in interface IDStabSimuOutputHandler
public void setOutputVarIdList(java.lang.String[] list)
IDStabSimuOutputHandler
setOutputVarIdList
in interface IDStabSimuOutputHandler
public boolean isOutputFilter()
IDStabSimuOutputHandler
isOutputFilter
in interface IDStabSimuOutputHandler
public void setOutputFilter(boolean b)
IDStabSimuOutputHandler
setOutputFilter
in interface IDStabSimuOutputHandler