SimulationCraft
SimulationCraft is a tool to explore combat mechanics in the popular MMO RPG World of Warcraft (tm).
sim_t Struct Reference

Simulation engine. More...

#include <sim.hpp>

Inheritance diagram for sim_t:
sc_thread_t

Classes

struct  auras_t
 
struct  bfa_opt_t
 
struct  legion_opt_t
 
struct  overrides_t
 
struct  shadowlands_opt_t
 

Public Member Functions

 sim_t (sim_t *parent, int thread_index=0)
 
 sim_t (sim_t *parent, int thread_index, sim_control_t *control)
 
void run () override
 
int main (const std::vector< std::string > &args)
 
double iteration_time_adjust ()
 
double expected_max_time () const
 
bool is_canceled () const
 
void cancel_iteration ()
 
void cancel ()
 Cancel simulation.
 
void interrupt ()
 
void add_relative (sim_t *cousin)
 
void remove_relative (sim_t *cousin)
 
sim_progress_t progress (std::string *detailed=nullptr, int index=-1)
 
double progress (std::string &phase, std::string *detailed=nullptr, int index=-1)
 
void detailed_progress (std::string *, int current_iterations, int total_iterations)
 
void datacollection_begin ()
 
void datacollection_end ()
 
void reset ()
 Reset simulation.
 
void check_actors ()
 check for active player More...
 
void init_fight_style ()
 configure fight style More...
 
void init_parties ()
 configure parties More...
 
void init_actors ()
 Initialize actors.
 
void init_actor (player_t *)
 
void init_actor_pets ()
 
void init ()
 
void analyze ()
 
void merge (sim_t &other_sim)
 merge sims
 
void merge ()
 merge all sims together
 
bool iterate ()
 
void partition ()
 
bool execute ()
 
void analyze_error ()
 
void analyze_iteration_data ()
 Build a N-highest/lowest iteration table for deterministic so they can be replayed.
 
void print_options ()
 
void add_option (std::unique_ptr< option_t > opt)
 
void create_options ()
 
bool parse_option (const std::string &name, const std::string &value)
 
void setup (sim_control_t *)
 
bool time_to_think (timespan_t proc_time)
 
player_tfind_player (util::string_view name) const
 find player in sim by name
 
player_tfind_player (int index) const
 find player in sim by actor index
 
cooldown_tget_cooldown (util::string_view name)
 
void use_optimal_buffs_and_debuffs (int value)
 
std::unique_ptr< expr_tcreate_expression (util::string_view name)
 
template<typename... Args>
void errorf (util::string_view format, Args &&... args)
 Create error with printf formatting.
 
template<typename... Args>
void error (fmt::format_string< Args... > format, Args &&... args)
 Create error using fmt libraries python-like formatting syntax.
 
void abort ()
 
void combat ()
 
void combat_begin ()
 Start combat.
 
void combat_end ()
 
void add_chart_data (const highchart::chart_t &chart)
 add chart to sim for end of report processing
 
bool has_raid_event (util::string_view type) const
 
void activate_actors ()
 
timespan_t current_time () const
 
void register_target_data_initializer (std::function< void(actor_target_data_t *)> cb)
 
const rng::rng_trng () const
 
rng::rng_trng ()
 
double averaged_range (double min, double max)
 
std::thread::id thread_id () const
 
template<typename... Args>
void print_debug (fmt::format_string< Args... > format, Args &&... args)
 Convenient stdout print function using python-like formatting. More...
 
template<typename... Args>
void print_log (fmt::format_string< Args... > format, Args &&... args)
 Convenient log function using python-like formatting. More...
 

Static Public Member Functions

static double distribution_mean_error (const sim_t &s, const extended_sample_data_t &sd)
 

Public Attributes

event_manager_t event_mgr
 
sim_ostream_t out_log
 
sim_ostream_t out_debug
 
bool debug
 
bool strict_parsing
 Error on unknown options (default=false) More...
 
bool canceled
 
bool cleanup_threads
 
bool initialized
 
bool fixed_time
 
bool save_profiles
 
bool save_profile_with_actions
 
bool default_actions
 
timespan_t max_time
 
timespan_t expected_iteration_time
 
double vary_combat_length
 
int current_iteration
 
int iterations
 
double target_error
 
role_e target_error_role
 
double current_error
 
double current_mean
 
int analyze_error_interval
 
int analyze_number
 
sim_control_tcontrol
 
sim_tparent
 
player_ttarget
 
player_theal_target
 
vector_with_callback< player_t * > target_list
 
vector_with_callback< player_t * > target_non_sleeping_list
 
vector_with_callback< player_t * > player_list
 
vector_with_callback< player_t * > player_no_pet_list
 
vector_with_callback< player_t * > player_non_sleeping_list
 
vector_with_callback< player_t * > healing_no_pet_list
 
vector_with_callback< player_t * > healing_pet_list
 
player_tactive_player
 
size_t current_index
 
int num_players
 
int num_enemies
 
int num_tanks
 
int enemy_targets
 
int healing
 
int global_spawn_index
 
int max_player_level
 
timespan_t queue_lag
 
timespan_t queue_lag_stddev
 
timespan_t gcd_lag
 
timespan_t gcd_lag_stddev
 
timespan_t channel_lag
 
timespan_t channel_lag_stddev
 
timespan_t queue_gcd_reduction
 
timespan_t default_cooldown_tolerance
 
bool strict_gcd_queue
 
double confidence
 
double confidence_estimator
 
timespan_t world_lag
 
timespan_t world_lag_stddev
 
double travel_variance
 
double default_skill
 
timespan_t reaction_time
 
timespan_t regen_periodicity
 
timespan_t ignite_sampling_delta
 
int optimize_expressions
 
int optimize_expressions_rounds
 
int current_slot
 
int optimal_raid
 
int log
 
int debug_each
 
std::vector< uint64_t > debug_seed
 
stat_e normalized_stat
 
std::string current_name
 
std::string default_region_str
 
std::string default_server_str
 
std::string save_prefix_str
 
std::string save_suffix_str
 
bool save_talent_str
 
talent_format talent_input_format
 
auto_dispose< std::vector< player_t * > > actor_list
 
std::string main_target_str
 
int stat_cache
 
int max_aoe_enemies
 
double tmi_window_global
 
double tmi_bin_size
 
bool show_etmi
 
bool requires_regen_event
 
bool single_actor_batch
 
bool allow_experimental_specializations
 
int progressbar_type
 
int armory_retries
 
double enemy_death_pct
 
int rel_target_level
 
int target_level
 
std::string target_race
 
int target_adds
 
std::string sim_progress_base_str
 
std::string sim_progress_phase_str
 
int desired_targets
 
std::unique_ptr< dbc_tdbc
 
std::unique_ptr< dbc_override_tdbc_override
 
gear_stats_t enchant
 
int timewalk
 
int scale_to_itemlevel
 
int keystone_level
 
int keystone_pct_hp
 
std::string keystone_bounty
 
bool challenge_mode
 
bool scale_itemlevel_down_only
 
bool disable_set_bonuses
 
bool enable_taunts
 
bool use_item_verification
 
unsigned int disable_2_set
 
unsigned int disable_4_set
 
unsigned int enable_2_set
 
unsigned int enable_4_set
 
const spell_data_tpvp_rules
 
bool pvp_mode
 
bool feast_as_dps = true
 
bool auto_attacks_always_land
 
bool log_spell_id
 Allow Auto Attacks (white attacks) to always hit the enemy.
 
int active_enemies
 
int active_allies
 
std::vector< std::unique_ptr< option_t > > options
 
std::vector< std::string > party_encoding
 
std::vector< std::string > item_db_sources
 
rng::rng_t _rng
 
uint64_t seed
 
int deterministic
 
int strict_work_queue
 
int average_range
 
int average_gauss
 
std::vector< std::unique_ptr< raid_event_t > > raid_events
 
std::string raid_events_str
 
fight_style_e fight_style
 
size_t add_waves
 
struct sim_t::overrides_t overrides
 
struct sim_t::auras_t auras
 
struct sim_t::legion_opt_t legion_opts
 
struct sim_t::bfa_opt_t bfa_opts
 
struct sim_t::shadowlands_opt_t shadowlands_opts
 
auto_dispose< std::vector< buff_t * > > buff_list
 
timespan_t default_aura_delay
 
timespan_t default_aura_delay_stddev
 
auto_dispose< std::vector< cooldown_t * > > cooldown_list
 
azerite_control azerite_status
 Status of azerite-related effects.
 
progress_bar_t progress_bar
 
std::unique_ptr< scale_factor_control_tscaling
 
std::unique_ptr< plot_tplot
 
std::unique_ptr< reforge_plot_treforge_plot
 
chrono::cpu_clock::duration elapsed_cpu
 
chrono::wall_clock::duration elapsed_time
 
std::vector< size_t > work_per_thread
 
size_t work_done
 
double iteration_dmg
 
double priority_iteration_dmg
 
double iteration_heal
 
double iteration_absorb
 
simple_sample_data_t raid_dps
 
simple_sample_data_t total_dmg
 
simple_sample_data_t raid_hps
 
simple_sample_data_t total_heal
 
simple_sample_data_t total_absorb
 
simple_sample_data_t raid_aps
 
extended_sample_data_t simulation_length
 
chrono::wall_clock::duration merge_time
 
chrono::wall_clock::duration init_time
 
chrono::wall_clock::duration analyze_time
 
std::vector< iteration_data_entry_titeration_data
 
std::vector< iteration_data_entry_tlow_iteration_data
 
std::vector< iteration_data_entry_thigh_iteration_data
 
double report_iteration_data
 
int min_report_iteration_data
 
int report_progress
 
int bloodlust_percent
 
timespan_t bloodlust_time
 
std::string reference_player_str
 
std::vector< player_t * > players_by_dps
 
std::vector< player_t * > players_by_priority_dps
 
std::vector< player_t * > players_by_hps
 
std::vector< player_t * > players_by_hps_plus_aps
 
std::vector< player_t * > players_by_dtps
 
std::vector< player_t * > players_by_tmi
 
std::vector< player_t * > players_by_name
 
std::vector< player_t * > players_by_apm
 
std::vector< player_t * > players_by_variance
 
std::vector< player_t * > targets_by_name
 
std::vector< std::string > id_dictionary
 
std::map< double, std::vector< double > > divisor_timeline_cache
 
std::vector< report::json::report_configuration_tjson_reports
 
std::string output_file_str
 
std::string html_file_str
 
std::string json_file_str
 
std::string reforge_plot_output_file_str
 
std::vector< std::string > error_list
 
int report_precision
 
int report_pets_separately
 
int report_targets
 
int report_details
 
int report_raw_abilities
 
int report_rng
 
int hosted_html
 
int save_raid_summary
 
int save_gear_comments
 
int statistics_level
 
int separate_stats_by_actions
 
int report_raid_summary
 
int buff_uptime_timeline
 
int buff_stack_uptime_timeline
 
bool json_full_states
 
int decorated_tooltips
 
int allow_potions
 
int allow_food
 
bool allow_flasks
 
int allow_augmentations
 
int solo_raid
 
bool maximize_reporting
 
std::string apikey
 
std::string user_apitoken
 
bool distance_targeting_enabled
 
bool ignore_invulnerable_targets
 
bool enable_dps_healing
 
bool count_overheal_as_heal
 
double scaling_normalized
 
bool merge_enemy_priority_dmg
 
mutex_t merge_mutex
 
int threads
 
std::vector< sim_t * > children
 
int thread_index
 
computer_process::priority_e process_priority
 
std::shared_ptr< work_queue_twork_queue
 
mutex_t relatives_mutex
 
std::vector< sim_t * > relatives
 
std::unique_ptr< spell_data_expr_tspell_query
 
unsigned spell_query_level
 
std::string spell_query_xml_output_file_str
 
std::unique_ptr< mutex_tpause_mutex
 
bool paused
 
std::vector< std::string > on_ready_chart_data
 
std::map< std::string, std::vector< std::string > > chart_data
 
bool chart_show_relative_difference
 
bool relative_difference_from_max
 
std::string relative_difference_base
 
double chart_boxplot_percentile
 
std::vector< std::function< void(actor_target_data_t *)> > target_data_initializer
 
bool display_hotfixes
 
bool disable_hotfixes
 
bool display_bonus_ids
 
opts::map_list_t profileset_map
 
std::vector< scale_metric_e > profileset_metric
 
std::vector< std::string > profileset_output_data
 
bool profileset_enabled
 
int profileset_work_threads
 
int profileset_init_threads
 
std::unique_ptr< profileset::profilesets_tprofilesets
 

Detailed Description

Simulation engine.

Member Function Documentation

◆ check_actors()

void sim_t::check_actors ( )

check for active player

This function just checks that the sim has at least 1 active player, and sets fixed_time automatically if the only role present is a ROLE_HEAL. Called in sim_t::init_actors()

◆ init_fight_style()

void sim_t::init_fight_style ( )

configure fight style

Parses fight style information into specific simulator defines. Performed as a separate initialization step (early) in the simulator init process to avoid positional dependencies between options (first and foremost, the max_time option).

Note that there are side-effects of this, namely that where fight styles define other options (e.g., Ultraxion), those can no longer be overwritten on the command line.

◆ init_parties()

void sim_t::init_parties ( )

configure parties

This function... builds parties? I guess it assigns each player in player_list to a party based on party_encoding. Called in sim_t::init_actors()

◆ print_debug()

template<typename... Args>
void sim_t::print_debug ( fmt::format_string< Args... >  format,
Args &&...  args 
)
inline

Convenient stdout print function using python-like formatting.

Print to stdout Print using fmt libraries python-like formatting syntax. Convenient debug function using python-like formatting.

Checks if sim debug is enabled. Print using fmt libraries python-like formatting syntax.

◆ print_log()

template<typename... Args>
void sim_t::print_log ( fmt::format_string< Args... >  format,
Args &&...  args 
)
inline

Convenient log function using python-like formatting.

Checks if sim logging is enabled. Print using fmt libraries python-like formatting syntax.

Member Data Documentation

◆ strict_parsing

bool sim_t::strict_parsing

Error on unknown options (default=false)

By default Simulationcraft will ignore unknown sim, player, item, or action-scope options. Enable this to hard-fail the simulator option parsing if an unknown option name is used for a given scope.