IrrigationMaster.java

1
package com.takenoko.bot;
2
3
import com.takenoko.bot.unitary.SmartDrawIrrigation;
4
import com.takenoko.bot.unitary.SmartPlaceIrrigation;
5
import com.takenoko.bot.unitary.SmartStoreIrrigation;
6
import com.takenoko.engine.Board;
7
import com.takenoko.engine.BotState;
8
import com.takenoko.engine.History;
9
import java.util.Map;
10
import java.util.Objects;
11
12
public class IrrigationMaster extends PriorityBot {
13
    private final Map<String, Integer> params;
14
15
    static final Map<String, Integer> DEFAULT_PARAMS =
16
            Map.of(
17
                    "placeIrrigationCoefficient", 1,
18
                    "drawIrrigationCoefficient", 1,
19
                    "storeIrrigationCoefficient", 1,
20
                    "maxIrrigationToChooseToDraw", 5);
21
22
    public IrrigationMaster(Map<String, Integer> params) {
23
        this.params = params;
24
    }
25
26
    public IrrigationMaster() {
27
        this.params = DEFAULT_PARAMS;
28
    }
29
30
    @Override
31
    protected void fillAction(Board board, BotState botState, History history) {
32 1 1. fillAction : removed call to com/takenoko/bot/IrrigationMaster::addWithOffset → TIMED_OUT
        this.addWithOffset(
33
                new SmartPlaceIrrigation().compute(board, botState, history),
34
                params.get("placeIrrigationCoefficient"));
35 1 1. fillAction : removed call to com/takenoko/bot/IrrigationMaster::addWithOffset → TIMED_OUT
        this.addWithOffset(
36
                new SmartDrawIrrigation(params.get("maxIrrigationToChooseToDraw"))
37
                        .compute(board, botState, history),
38
                params.get("drawIrrigationCoefficient"));
39 1 1. fillAction : removed call to com/takenoko/bot/IrrigationMaster::addWithOffset → TIMED_OUT
        this.addWithOffset(
40
                new SmartStoreIrrigation().compute(board, botState, history),
41
                params.get("storeIrrigationCoefficient"));
42
    }
43
44
    @Override
45
    public boolean equals(Object o) {
46 2 1. equals : negated conditional → NO_COVERAGE
2. equals : replaced boolean return with false for com/takenoko/bot/IrrigationMaster::equals → NO_COVERAGE
        if (this == o) return true;
47 3 1. equals : negated conditional → NO_COVERAGE
2. equals : negated conditional → NO_COVERAGE
3. equals : replaced boolean return with true for com/takenoko/bot/IrrigationMaster::equals → NO_COVERAGE
        if (o == null || getClass() != o.getClass()) return false;
48 2 1. equals : negated conditional → NO_COVERAGE
2. equals : replaced boolean return with true for com/takenoko/bot/IrrigationMaster::equals → NO_COVERAGE
        if (!super.equals(o)) return false;
49
        IrrigationMaster that = (IrrigationMaster) o;
50 2 1. equals : replaced boolean return with false for com/takenoko/bot/IrrigationMaster::equals → NO_COVERAGE
2. equals : replaced boolean return with true for com/takenoko/bot/IrrigationMaster::equals → NO_COVERAGE
        return Objects.equals(params, that.params);
51
    }
52
53
    @Override
54
    public int hashCode() {
55 1 1. hashCode : replaced int return with 0 for com/takenoko/bot/IrrigationMaster::hashCode → NO_COVERAGE
        return Objects.hash(super.hashCode(), params);
56
    }
57
}

Mutations

32

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

35

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

39

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

46

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/IrrigationMaster::equals → NO_COVERAGE

47

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/IrrigationMaster::equals → NO_COVERAGE

48

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/IrrigationMaster::equals → NO_COVERAGE

50

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

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

55

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

Active mutators

Tests examined


Report generated by PIT 1.8.0