public Edge Claim(GameState gameState) { componentManager.UpdateMap(gameState.Map); Edge edge; if (lambdasCount > 0) { edge = componentManager.GetMineEdge(); --lambdasCount; } else { if (desire != null && (desire.Components.Count <= 1 || !componentManager.IsConnected(desire))) { desire = GetDesire(); } edge = desire == null ? componentManager.GetMostExpensiveEdge() : componentManager.GetFragileEdge(desire); } componentManager.ClaimEdge(edge.Source, edge.Target, desire); movesCount--; return(edge); }
public Edge Claim(GameState gameState) { if (state.puntersCount == 2) { return(new BargeHauler3(scorer, graphVisitor).Claim(gameState)); } componentManager.UpdateMap(gameState.Map); Edge edge; if (state.lambdasCount > 0) { edge = componentManager.GetMineEdge(); --state.lambdasCount; } else { if (state.desire != null && (state.desire.Components.Count <= 1 || !componentManager.IsConnected(state.desire))) { state.desire = GetDesire(); } edge = state.desire == null ? new BargeHauler3(scorer, graphVisitor).Claim(gameState) : componentManager.GetFragileEdge(state.desire); } componentManager.ClaimEdge(edge.Source, edge.Target, state.desire); state.movesCount--; return(edge); }
public Edge Claim(GameState gameState) { componentManager.UpdateMap(gameState.Map); Edge edge; if (lambdasCount > 0) { edge = componentManager.GetMineEdge(); --lambdasCount; } else { if (desire != null && (desire.Components.Count <= 1 || !componentManager.IsConnected(desire))) { desire = GetDesire(); } if (desire == null) { if (fullDesire == null || fullDesire.Components.Count <= 1 || !componentManager.IsConnected(fullDesire)) { fullDesire = componentManager.FindGreedyFullComponent(10); } edge = componentManager.GetFragileEdge(fullDesire); } else { edge = componentManager.GetFragileEdge(desire); } } componentManager.ClaimEdge(edge.Source, edge.Target, desire ?? fullDesire); movesCount--; return(edge); }
public Edge Claim(GameState gameState) { componentManager.UpdateMap(gameState.Map); var component = componentManager.GetBestComponentByChart(movesCount / 2); --movesCount; var edge = componentManager.GetMostExpensiveFromComponentEdge(component); componentManager.ClaimEdge(edge.Source, edge.Target); return(edge); }
public Edge Claim(GameState gameState) { componentManager.UpdateMap(gameState.Map); if (!componentManager.IsConnected(desire)) { desire = componentManager.FindGreedyFullComponent(movesCount + 1); } movesCount--; var edge = componentManager.GetFragileEdge(desire); componentManager.ClaimEdge(edge.Source, edge.Target, desire); return(edge); }