Skip to content

Instantly share code, notes, and snippets.

trait Action {
// ...
def instantiate(inventory: ResourceMap[Resource], units: Iterable[Unit]):ActionMachine
}
class BuildAction(tpe: UnitType) extends AwesomeAction {
def instantiate(inventory: ResourceMap[Resource], units: Iterable[Unit]):ActionMachine = new ActionMachine {
anonymous
anonymous / StrongWolfe.scala
Created April 23, 2013 00:16
Strong wolfe line search
import breeze.linalg._
import breeze.numerics._
import breeze.optimize.DiffFunction
abstract class LineSearch extends Log {
case class Bracket(
t : Double, // 1d line search parameter
dd : Double, // Directional Derivative at t
fval : Double // Function value at t