@Component @Lazy @DependentInitialisation(value=MapInitializedBean.class) public class CitiesState extends Object
| Modifier and Type | Field and Description |
|---|---|
private ConcurrentHashMap<ICity,CityState> |
cities
List of all the cities coupled with their state to be handeld by this engine
|
private IMap |
map |
private Random |
rnd |
| Constructor and Description |
|---|
CitiesState() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCity(ICity city,
CityState cityState)
Add a new city.
|
Optional<ch.sahits.datastructure.GenericPair<ICity,IWare>> |
findCityWithMostNeededWare()
Find a possible city that has needed wares.
|
Optional<ch.sahits.datastructure.GenericPair<ICity,IWare>> |
findCityWithSurplusWare()
Find a possible city that has needed wares.
|
List<CityState> |
getCityEngineStates() |
void |
init() |
@Autowired private IMap map
@Autowired private Random rnd
private ConcurrentHashMap<ICity,CityState> cities
public void init()
public Optional<ch.sahits.datastructure.GenericPair<ICity,IWare>> findCityWithMostNeededWare()
public Optional<ch.sahits.datastructure.GenericPair<ICity,IWare>> findCityWithSurplusWare()
Copyright © 2011-2016 Sahits GmbH. All Rights Reserved.