This paper proposes a method to the model constraints from different models to run an optimization over models with different granularities. Through machine learning, the proposed method has proven to be able to accurately map the constraints and minimize the number of call to the model. It handles both continuous and discrete variables and mixes design rules to statistic approach to create a surrogate of the model.