WeatherMaster.java

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

Mutations

30

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

33

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

40

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

41

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

42

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

44

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

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

49

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

Active mutators

Tests examined


Report generated by PIT 1.8.0