Creates the initial model for the optimistation.

        Raises
        ------
        TypeError
            Raised if the model failed to build. This could be due to
            parameters being passed to the specification in the wrong
            format.

def _generate_initial_model(self):
        """Creates the initial model for the optimistation.

        Raises
        ------
        TypeError
            Raised if the model failed to build. This could be due to
            parameters being passed to the specification in the wrong
            format.
        """
        initial_parameters = [p.current_value for p in self.current_parameters]
        try:
            initial_model = self.specification(*initial_parameters)
        except TypeError:
            raise TypeError(
                'Failed to build initial model. Make sure that the input '
                'parameters match the number and order of arguements '
                'expected by the input specification.')
        initial_model.pack_new_sequences(self.sequences)
        self.current_energy = self.eval_function(initial_model)
        self.best_energy = copy.deepcopy(self.current_energy)
        self.best_parameters = copy.deepcopy(self.current_parameters)
        self.best_model = initial_model
        return