See our new simulator (https://github.com/kqorany/FREE), which is more comprehensive than LoRaSim, considering the downlink capability and a theoretical packet error model, etc.
This framework (https://github.com/GillesC/LoRaEnergySim) is built with Python and includes retransmission, energy consumption of individual nodes, Adapative Data Rate, ...
I have used machine learning for optimizing LoRa channel selection here. This implementation also include a system level implementation of LoRaWAN basics.