private int[] testEmployee(int[] order) { float[] inputs = Menu.createOrder(order); float[] recipe = Recipes.getRecipeVector(order); employee.feedForward(inputs); float[] outputs = employee.getOutputs(); int numberOfIngredients = Functions.count(1.0f, recipe); int[] employeeChoices = Functions.getNGreatestIndices(outputs, numberOfIngredients); if (train) { employee.train(recipe); } return(employeeChoices); }
public void giveOrder(Order order) { this.order = order; idle = false; this.orderVector = getOrderVector(order.order); this.recipeVector = Recipes.getRecipeVector(order.order); network.feedForward(orderVector); int[] recipe = Functions.removeDuplicates(Functions.intComparer, order.recipe); this.choices = Functions.getNGreatestIndices(network.getOutputs(), recipe.Length); int[] destinations = kitchen.getPreparationLocations(choices); foreach (int destination in destinations) { this.destinations.Push(destination); } setNextDestination(); }