Abstract. An integrated simulation code TOPICS-IB based on a transport code with a stability code for the peeling-ballooning modes and a scrape-off-layer (SOL) model has been developed to clarify self-consistent effects of edge localized modes (ELMs) and SOL on the plasma performance. Experimentally observed collisionality dependence of the ELM energy loss is found to be caused by both the edge bootstrap current and the SOL transport. The bootstrap current decreases with increasing the collisionality and intensifies the magnetic shear at the pedestal region. The increase of the magnetic shear reduces the width of eigenfunctions of unstable modes, which results in the reduction of the area and the edge value near the separatrix of the ELM enhanced transport. On the other hand, when an ELM crash occurs, the energy flows into the SOL and the SOL temperature rapidly increases. The increase of the SOL temperature lowers the ELM energy loss due to the flattening of the radial edge gradient. The parallel electron heat conduction determines how the SOL temperature increases. For higher collisionality, the conduction becomes lower and the SOL electron temperature increases more. By the above two mechanisms, the ELM energy loss decreases with increasing the collisionality. The bootstrap current and the SOL transport have the major effect on the collisionality dependence.