ld-archer / E_FEM

This is the repository for the English version of the Future Elderly Model, originally developed at the Leonard D. Schaeffer Center for Health Policy and Microsimulation.
MIT License
3 stars 1 forks source link

94 social isolation index #106

Closed ld-archer closed 1 year ago

ld-archer commented 1 year ago

Closes #94. This PR just includes the work to add the index of social isolation to the FEM, along with dealing with a particularly cryptic C++ error.

Segmentation Fault

This was the error, and making a note of it here just in case I come across it again later. The error was caused by duplicating the definitions of some variables between ELSA_vars.txt and FEM_CPP/Vars.cpp. What I think happened, is by duplicating these definitions it creates a buffer overflow where the C++ pointer is trying to access memory it does not have permission to access (I won't pretend to understand this properly, but I think it means that the pointer was trying to access and write a read-only chunk of memory that was potentially already being written from elsewhere, or otherwise engaged by the other definition of the variable). The fix was to comment out the definitions in ELSA_vars.txt, but leads to a question on where the best place is to define these summary variables so they are correctly assigned at each wave.