Greatest Happiness Principle in a Complex System Approach