The loadshed example runhpy.sh produced incorrect results because the switch did not open or close in GridLAB-D. The log said keyword 'OPENᄍU' is not valid for property phase_A_state. A temporary workaround was made by appending a null character in helicshed.py as shown below. However, this wasn't required for the 6-character CLOSED message just above it.
if val == 1:
logger.info('Switching ' + end_name + ' to CLOSED at second ' + str(t))
h.helicsEndpointSendMessageRaw(swStatusEp, '', 'CLOSED'.encode())
elif val == 0:
logger.info('Switching ' + end_name + ' to OPEN at second ' + str(t))
# h.helicsEndpointSendMessageRaw(swStatusEp, '', 'OPEN'.encode())
h.helicsEndpointSendMessageRaw(swStatusEp, '', 'OPEN\0'.encode())
This looks like a memory bug in ns-3-helics that manifests in the optimized build but not in the debug build. When fixed properly, it may also fix issue #32
The loadshed example
runhpy.sh
produced incorrect results because the switch did not open or close in GridLAB-D. The log saidkeyword 'OPENᄍU' is not valid for property phase_A_state
. A temporary workaround was made by appending a null character inhelicshed.py
as shown below. However, this wasn't required for the 6-characterCLOSED
message just above it.This looks like a memory bug in ns-3-helics that manifests in the optimized build but not in the debug build. When fixed properly, it may also fix issue #32