HAMA-681: add the CostFunctionFactory and SquashingFunctionFactory to
generate the cost function and squashing function respectively.