Model driven software engineering for grid modelling, optimization and simulation