RushPandaBot.java

1
package com.takenoko.bot;
2
3
import static com.takenoko.bot.utils.pathfinding.panda.PandaPathfinding.getPandaMovesThatEatBamboo;
4
5
import com.takenoko.actions.actors.ForcedMovePandaAction;
6
import com.takenoko.actions.actors.MovePandaAction;
7
import com.takenoko.actions.improvement.ApplyImprovementAction;
8
import com.takenoko.actions.improvement.ApplyImprovementFromInventoryAction;
9
import com.takenoko.actions.improvement.DrawImprovementAction;
10
import com.takenoko.bot.unitary.SmartDrawImprovement;
11
import com.takenoko.bot.unitary.SmartPanda;
12
import com.takenoko.engine.Board;
13
import com.takenoko.engine.BotState;
14
import com.takenoko.engine.History;
15
import com.takenoko.layers.tile.ImprovementType;
16
import com.takenoko.vector.PositionVector;
17
import java.util.List;
18
import java.util.Map;
19
import java.util.Objects;
20
21
public class RushPandaBot extends PriorityBot {
22
    private final transient FullRandomBot randomBot;
23
24
    public RushPandaBot() {
25
        super();
26
        this.randomBot = new FullRandomBot();
27
    }
28
29
    @Override
30
    protected void fillAction(Board board, BotState botState, History history) {
31
32 1 1. fillAction : removed call to com/takenoko/bot/RushPandaBot::addWithOffset → TIMED_OUT
        this.addWithOffset((new SmartPanda()).compute(board, botState, history), 50);
33
34 1 1. fillAction : removed call to com/takenoko/bot/RushPandaBot::addWithOffset → TIMED_OUT
        this.addWithOffset(
35
                (new SmartDrawImprovement(Map.of(ImprovementType.FERTILIZER, 1)))
36
                        .compute(board, botState, history),
37
                50);
38
39 1 1. fillAction : negated conditional → TIMED_OUT
        if (botState.getInventory().hasImprovement(ImprovementType.FERTILIZER)
40 1 1. fillAction : negated conditional → TIMED_OUT
                && botState.getAvailableActions().contains(ApplyImprovementAction.class)
41 1 1. fillAction : negated conditional → TIMED_OUT
                && !board.getAvailableImprovementPositions().isEmpty()) {
42 1 1. fillAction : removed call to com/takenoko/bot/RushPandaBot::addActionWithPriority → TIMED_OUT
            this.addActionWithPriority(
43
                    new ApplyImprovementFromInventoryAction(
44
                            ImprovementType.FERTILIZER,
45
                            board.getAvailableImprovementPositions().get(0)),
46
                    2);
47
        }
48
49
        List<PositionVector> pandaMoveThatEatBamboo = getPandaMovesThatEatBamboo(board);
50
51 1 1. fillAction : negated conditional → KILLED
        if (!pandaMoveThatEatBamboo.isEmpty()) {
52 1 1. fillAction : removed call to com/takenoko/bot/RushPandaBot::addActionWithPriority → TIMED_OUT
            this.addActionWithPriority(new MovePandaAction(pandaMoveThatEatBamboo.get(0)), 100);
53 1 1. fillAction : removed call to com/takenoko/bot/RushPandaBot::addActionWithPriority → TIMED_OUT
            this.addActionWithPriority(
54
                    new ForcedMovePandaAction(pandaMoveThatEatBamboo.get(0)), 100);
55
        }
56 1 1. fillAction : removed call to com/takenoko/bot/RushPandaBot::addActionWithPriority → TIMED_OUT
        this.addActionWithPriority(new DrawImprovementAction(ImprovementType.FERTILIZER), 1);
57
    }
58
59
    @Override
60
    public boolean equals(Object o) {
61 2 1. equals : negated conditional → NO_COVERAGE
2. equals : replaced boolean return with false for com/takenoko/bot/RushPandaBot::equals → NO_COVERAGE
        if (this == o) return true;
62 3 1. equals : negated conditional → NO_COVERAGE
2. equals : negated conditional → NO_COVERAGE
3. equals : replaced boolean return with true for com/takenoko/bot/RushPandaBot::equals → NO_COVERAGE
        if (o == null || getClass() != o.getClass()) return false;
63 2 1. equals : negated conditional → NO_COVERAGE
2. equals : replaced boolean return with true for com/takenoko/bot/RushPandaBot::equals → NO_COVERAGE
        if (!super.equals(o)) return false;
64
        RushPandaBot that = (RushPandaBot) o;
65 2 1. equals : replaced boolean return with false for com/takenoko/bot/RushPandaBot::equals → NO_COVERAGE
2. equals : replaced boolean return with true for com/takenoko/bot/RushPandaBot::equals → NO_COVERAGE
        return Objects.equals(randomBot, that.randomBot);
66
    }
67
68
    @Override
69
    public int hashCode() {
70 1 1. hashCode : replaced int return with 0 for com/takenoko/bot/RushPandaBot::hashCode → NO_COVERAGE
        return Objects.hash(super.hashCode(), randomBot);
71
    }
72
}

Mutations

32

1.1
Location : fillAction
Killed by : none
removed call to com/takenoko/bot/RushPandaBot::addWithOffset → TIMED_OUT

34

1.1
Location : fillAction
Killed by : none
removed call to com/takenoko/bot/RushPandaBot::addWithOffset → TIMED_OUT

39

1.1
Location : fillAction
Killed by : none
negated conditional → TIMED_OUT

40

1.1
Location : fillAction
Killed by : none
negated conditional → TIMED_OUT

41

1.1
Location : fillAction
Killed by : none
negated conditional → TIMED_OUT

42

1.1
Location : fillAction
Killed by : none
removed call to com/takenoko/bot/RushPandaBot::addActionWithPriority → TIMED_OUT

51

1.1
Location : fillAction
Killed by : com.takenoko.bot.utils.HistoryAnalysisTest.[engine:junit-jupiter]/[class:com.takenoko.bot.utils.HistoryAnalysisTest]/[nested-class:IntegrationTest]/[method:test1()]
negated conditional → KILLED

52

1.1
Location : fillAction
Killed by : none
removed call to com/takenoko/bot/RushPandaBot::addActionWithPriority → TIMED_OUT

53

1.1
Location : fillAction
Killed by : none
removed call to com/takenoko/bot/RushPandaBot::addActionWithPriority → TIMED_OUT

56

1.1
Location : fillAction
Killed by : none
removed call to com/takenoko/bot/RushPandaBot::addActionWithPriority → TIMED_OUT

61

1.1
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : equals
Killed by : none
replaced boolean return with false for com/takenoko/bot/RushPandaBot::equals → NO_COVERAGE

62

1.1
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : equals
Killed by : none
replaced boolean return with true for com/takenoko/bot/RushPandaBot::equals → NO_COVERAGE

63

1.1
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : equals
Killed by : none
replaced boolean return with true for com/takenoko/bot/RushPandaBot::equals → NO_COVERAGE

65

1.1
Location : equals
Killed by : none
replaced boolean return with false for com/takenoko/bot/RushPandaBot::equals → NO_COVERAGE

2.2
Location : equals
Killed by : none
replaced boolean return with true for com/takenoko/bot/RushPandaBot::equals → NO_COVERAGE

70

1.1
Location : hashCode
Killed by : none
replaced int return with 0 for com/takenoko/bot/RushPandaBot::hashCode → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.8.0