Resource Based Multi Agent Plan Merging: Framework and application