Modeling flexibility using artificial neural networks