ogd.games.LAKELAND.features package

Submodules

ogd.games.LAKELAND.features.ActionsLastXSecondsModel module

ogd.games.LAKELAND.features.DeathCountModel module

ogd.games.LAKELAND.features.DeathPredModel module

ogd.games.LAKELAND.features.DeathThresholdModel module

ogd.games.LAKELAND.features.DiagonalFarmDetectorModel module

ogd.games.LAKELAND.features.FeatSeqPercent module

ogd.games.LAKELAND.features.FeatVelocity module

ogd.games.LAKELAND.features.FeatureModel module

ogd.games.LAKELAND.features.LakelandExtractor module

Lakeland Feature Extractor Note that a separate file unique to the lakeland extractor is necessary to run this script. The file is Lakeland Enumerators.json, and is required for the line: _STR_TO_ENUM = utils.loadJSONFile(“games/LAKELAND/Lakeland Enumerators.json”)

This json file is created from the fielddaylab/lakeland README on github via “produce_lakeland_enumerators.py”. Please run that script with the appropriate inpath and outpath before running this script.

class ogd.games.LAKELAND.features.LakelandExtractor.LakelandExtractor(params: GeneratorParameters, game_schema: GameSchema, session_id: str)[source]

Bases: LegacyFeature

add_debug_str(s)[source]
feature_average(fname_base, value)[source]
feature_count(feature_base, windows=None)[source]
feature_inc(feature_base, increment, windows=None)[source]
feature_max_min(fname_base, val)[source]

feature must have the same fname_base that gets put on the following four features: - {_SESS_PREFIX}max_ - {_SESS_PREFIX}min_ - {_WINDOW_PREFIX}max_ - {_WINDOW_PREFIX}min_

feature_time_since_start(feature_base)[source]

Sets a session time since start feature. Will not write over a feature that has already been set. :param feature_base: name of feature without sess or window prefix :param cur_client_time: client time at which the event happened

finish_window(w)[source]
getValByIndex(feature_name, index)[source]
getValByName(feature_name)[source]
get_building_buildable_function()[source]
get_tile_types_xys(type_list)[source]
in_bounds(tx, ty)[source]
static index_to_xy(index)[source]
log_warning(message)[source]
milliseconds_to_datetime(milliseconds)[source]
static onscreen_item_dict()[source]
reformat_history_array(array, timestamp)[source]

This function should be done in the reformatting step. History arrays contain timestamps relative to another timestamp that is when the array is sent through the logger. This function returns an array with absolute datetimes. :param self: self :param array: array to be processed. These arrays are either a list of times relative to client time or a list of subarrays with the last item as the time before timestamp. :param timestamp: time that each element is relative to (Javascript Date.now(), milliseconds since beginning 1970 UTC) :return: A 2D array where each subarray’s final element is the absolute client time.

reset()[source]
setValByIndex(feature_name, index, new_value)[source]
setValByName(feature_name, new_value)[source]
set_time_in_nutrition_view(event_client_time)[source]
start_window(w)[source]
time_since_start(client_time)[source]
update_time_at_speed(event_client_time, prev_speed)[source]
ogd.games.LAKELAND.features.LakelandExtractor.avg(l)[source]

Returns average of a list. Allows elements to be datetime time intervals. :param l: list :return: Average (L1 distance between elements)

ogd.games.LAKELAND.features.LakelandExtractor.distance(point1, point2)[source]
Parameters:
  • point1 – x,y for point 1

  • point2 – x,y for point 2

Returns:

euclidean distance between x and y

ogd.games.LAKELAND.features.LakelandExtractor.get_tile_txy(tile)[source]
ogd.games.LAKELAND.features.LakelandExtractor.list_deltas(l)[source]
ogd.games.LAKELAND.features.LakelandExtractor.tile_i_to_xy(i)[source]

ogd.games.LAKELAND.features.LinearModel module

ogd.games.LAKELAND.features.LogisticModel module

ogd.games.LAKELAND.features.MapSummaryModel module

ogd.games.LAKELAND.features.Model module

class ogd.games.LAKELAND.features.Model.Model(input_type: ModelInputType, levels: List[int] = [])[source]

Bases: ABC

abstract Eval(rows: List) List[source]
GetInputType()[source]
class ogd.games.LAKELAND.features.Model.ModelInputType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

FEATURE = 1[source]
SEQUENCE = 2[source]

ogd.games.LAKELAND.features.MoneyAccumulationModel module

ogd.games.LAKELAND.features.NthEventModel module

ogd.games.LAKELAND.features.PlayingTimeModel module

ogd.games.LAKELAND.features.PopulationModel module

ogd.games.LAKELAND.features.RecentPurchasesModel module

ogd.games.LAKELAND.features.SequenceModel module

ogd.games.LAKELAND.features.SimpleFarmAbandonmentModel module

ogd.games.LAKELAND.features.SingleFeatureModel module

ogd.games.LAKELAND.features.TimeSinceEventTypes module

ogd.games.LAKELAND.features.TimeSinceLastSaleModel module

ogd.games.LAKELAND.features.TownCompositionFeatureModel module

ogd.games.LAKELAND.features.TownCompositionModel module

ogd.games.LAKELAND.features.TutorialProgressionModel module

Module contents

Initializer for Lakeland features