Ecostatistical mechanics: the aplication of statistical physics ideas to ecology