54 "The FED has decreased the interest rate!",
65 "The FED has increased the interest rate!",
76 "Economic Recession: Market Downturn Signals Investor Concerns",
88 "Central Bank Cuts Interest Rates: Market Stimulus Boosts Investor Sentiment",
100 "Trade War Escalates: Global Market Volatility Amidst Rising Tensions",
112 "Natural Disaster Strikes: Stock Market Reacts to Catastrophic Event",
123 "Government Policy Change: Market Impacted by New Regulations",
134 "Inflation Surges: Market Concerns Rise as Prices Soar",
146 "New Social Media Platform Disrupts Advertising Landscape",
157 "Digital Advertising Spend Reaches All-Time High",
168 "Marketing Automation Tools Gain Popularity Among Businesses",
179 "Artificial Intelligence Revolutionizes Targeted Advertising",
192 "Government Increases Defense Spending Amid Rising Geopolitical Tensions",
203 "Emerging Technologies Transform Aerospace Industry",
214 "Space Exploration Companies Achieve Major Milestones",
225 "Supply Chain Disruptions Hinder Aerospace Manufacturing",
236 "Budget Cuts Lead to Decreased Defense Contracts",
248 "Airline Industry Experiences Surge in Travel Demand",
260 "Fuel Prices Skyrocket, Putting Pressure on Airlines' Profit Margins",
271 "Airline Strikes Disrupt Travel Plans for Thousands of Passengers",
282 "New Low-Cost Airline Enters the Market, Intensifying Competition",
294 "Natural Disasters Disrupt Airline Operations and Cause Flight Cancellations",
305 "New Security Regulations Increase Operational Costs for Airlines",
318 "Government Implements New Incentives to Promote Renewable Energy Adoption",
330 "Breakthrough in Solar Panel Technology Increases Efficiency by 20%",
341 "Investment in Wind Farms Surges as Costs of Wind Energy Decrease",
353 "Government Cuts Subsidies for Renewable Energy Projects, Slowing Down "
365 "Persistent Cloud Cover Reduces Solar Power Generation",
378 "Breakthrough in Electric Vehicle Battery Technology Extends Range and Reduces "
391 "Sudden Increase in Oil Prices Impacts Affordability and Demand for "
392 "Conventional Vehicles",
404 "Introduction of Advanced Driver Assistance Systems Enhances Vehicle Safety",
415 "Frequent Accidents raise safety Concerns",
428 "Economic Recession Triggers Increase in Non-Performing Loans, Putting Banks "
441 "Government Introduces Stimulus Package to Boost Lending and Economic Growth",
453 "Government Implements Excessive Money Printing, Leading to Inflation and "
454 "Currency Devaluation",
467 "Breakthrough in Gene Therapy Offers Potential Cure for Genetic Diseases",
479 "Clinical Trial Failure Delays Development of Promising Drug Candidate",
491 "Successful FDA Approval Expedites Commercialization of Innovative Biotech "
505 "New Streaming Service Launches with Extensive Content Library and Innovative "
518 "Broadcast Network Faces Significant Revenue Losses Due to Declining "
531 "Broadcast Network Strikes Exclusive Deal for Live Coverage of Major Sporting "
544 "Stringent Gambling Regulations Restrict Casino Operations",
556 "Innovative Strategies Help Casinos Navigate Stringent Regulations and "
557 "Minimize Revenue Losses",
569 "Online Gaming Goes Viral, Attracting Millions of Players Worldwide",
580 "New Esports Tournament Breaks Viewership Records",
592 "Major Data Breach Affects Gaming Platforms, Raising Concerns About Player "
605 "Introduction of Virtual Reality Gaming Enhances Player Immersion and "
619 "E-commerce Sales Reach All-Time High, Exceeding Market Expectations",
631 "Supply Chain Disruptions Cause Delivery Delays and Inventory Shortages in "
644 "Introduction of Innovative Payment Solutions Boosts E-commerce Conversion "
657 "Cybersecurity Breach Raises Concerns About Online Shopping Privacy and Data "
670 "Advancements in Artificial Intelligence Revolutionize Personalized Shopping "
684 "Fintech Startups Disrupt Traditional Banking, Providing Innovative Financial "
696 "Stock Market Crash Leads to Financial Turmoil and Investor Losses",
708 "Introduction of Blockchain Technology Enhances Security and Efficiency in "
709 "Financial Transactions",
721 "Digital Wallets Gain Popularity, Simplifying Payment Processes and Increasing "
722 "Financial Inclusion",
735 "Plant-Based Food Trend Continues to Grow, Offering Healthier and Sustainable "
748 "Food Safety Scandal Raises Concerns About Contaminated Products and Consumer "
761 "Introduction of Innovative Cooking Techniques Enhances Culinary Experiences",
773 "Global Food Shortage Crisis Impacts Prices and Availability of Essential "
786 "Rise of Food Delivery Services Provides Convenient and Wide-ranging Dining "
799 "Growing Demand for Organic and Locally Sourced Food Drives Sustainable "
813 "Advancements in Telemedicine Improve Access to Medical Care for Remote Areas",
825 "Outbreak of Global Pandemic Leads to Overwhelmed Healthcare Systems and High "
838 "Development of Personalized Medicine Leads to More Effective Treatment and "
839 "Prevention Strategies",
851 "Shortage of Healthcare Professionals Causes Strain on Medical Services and "
864 "Advancements in Gene Editing Technology Open New Avenues for Precision "
878 "Breakthrough in Artificial Intelligence Leads to Significant Advancements in "
879 "Automation and Machine Learning",
891 "Cybersecurity Breach Exposes Sensitive Data and Raises Concerns Over Digital "
904 "Emergence of 5G Technology Revolutionizes Connectivity and Enables Faster "
917 "Failure of Major Tech Infrastructure Disrupts Services and Causes Widespread "
930 "Advancements in Quantum Computing Unlock New Possibilities for Solving "
943 "Rapid Advancements in Augmented Reality (AR) and Virtual Reality (VR) Enhance "
956 "Advancements in Robotics and Automation Transform Manufacturing and Increase "
969 "Emergence of Artificial General Intelligence (AGI) Raises Ethical and "
983 "Strong Demand and Low Mortgage Rates Drive Real Estate Market Growth",
995 "Economic Downturn Leads to Decline in Real Estate Prices and Sales",
1007 "Rapid Urbanization and Infrastructure Development Boost Real Estate "
1020 "Natural Disasters Cause Property Damage and Impact Real Estate Market",
1032 "Investigation Reveals Widespread Cases of Substandard Construction Projects",
1045 "Shift in Consumer Behavior Leads to Decline in Brick-and-Mortar Retail Stores",
1057 "Adoption of Technology Enhances Customer Experience in Physical Retail Stores",
1069 "Integration of Augmented Reality Enhances In-Store Shopping Experience",
1081 "Increase in Online Counterfeit Products Impacts Consumer Trust in E-commerce",
1093 "Retailers Embrace Sustainable Practices, Driving Eco-friendly Consumer "
1105 "Supply Chain Disruptions Impact Retail Inventory and Availability",
1118 "Deployment of 5G Networks Enables Faster and More Reliable Connectivity",
1130 "Cybersecurity Breach in Telecom Networks Raises Concerns over Data Privacy",
1142 "Advancements in Voice Recognition Technology Enhance Telecommunication "
1155 "Network Outage Disrupts Telecommunication Services in Several Regions",
1167 "Telecom Service Outage Caused by Natural Disaster Disrupts Communication",
1179 "Telecom Regulatory Changes Affect Pricing and Service Plans for Consumers",
1191 "Leadership Change: CEO Resigns, New CEO Appointed",
1203 "Labor Strike: Employees Go on Strike Demanding Better Working Conditions",
1214 "Acquires a Competitor, Expands Market Presence",
1225 "Market Slump Leads to Business Contraction",
1236 "Regulatory Non-Compliance: Fails to Meet Environmental Standards",
1247 "Faces Bankruptcy, Forced to Cease Operations",
1258 "Opens New Branches in Multiple Locations",
1269void print_map(
const std::map<
unsigned int, std::vector<unsigned int>> & map) {
1270 for (
const auto & i : map) {
1271 std::cout << i.first <<
": ";
1272 for (
unsigned int j : i.second) {
1273 std::cout << j <<
" ";
1275 std::cout << std::endl;
1294 const std::vector<Stock_event> & all_events) {
1297 for (
unsigned int i = 0; i < all_events.size(); i++) {
1298 for (
unsigned int j = 0; j < all_events[i].mutually_exclusive_events.size();
1300 mut_excl_map[all_events[i].event_id].emplace_back(
1301 all_events[i].mutually_exclusive_events[j]);
1304 return mut_excl_map;
1308 const std::vector<Stock_event> & all_events) {
1315 for (
const auto & i : mut_excl_map) {
1316 for (
unsigned int j : i.second) {
1317 if (std::find(mut_excl_map[j].begin(), mut_excl_map[j].end(), i.first) !=
1318 mut_excl_map[j].end()) {
1319 mut_excl_map[i.first].erase(std::remove(mut_excl_map[i.first].begin(),
1320 mut_excl_map[i.first].end(), j),
1321 mut_excl_map[i.first].end());
1322 mut_excl_map[j].erase(std::remove(mut_excl_map[j].begin(),
1323 mut_excl_map[j].end(), i.first),
1324 mut_excl_map[j].end());
1328 return mut_excl_map;
1335 for (
const auto & [key, value] : checkEventResult) {
1338 if (!value.empty()) {
1339 std::cout <<
"Error: detected mutual exclusivity violation! Details:"
1349 const std::vector<Stock_event> & all_events,
unsigned int num_events) {
1350 std::vector<Stock_event> picked_events;
1351 unsigned int total_permille = 0;
1355 total_permille +=
event.probability_permille;
1358 for (
unsigned int i = 0; i < num_events; i++) {
1359 unsigned int _total_permille = total_permille;
1370 _total_permille -=
event.probability_permille;
1371 if (_total_permille <= random_permille) {
1372 picked_events.emplace_back(event);
1380std::vector<Stock_event>
uniq_events(std::vector<Stock_event> picked_events,
1381 const std::vector<Stock_event> & all_events) {
1384 unsigned int first = 0;
1385 while (first < picked_events.size()) {
1386 unsigned int second = first + 1;
1387 while (second < picked_events.size()) {
1388 const bool isRandomStockEvents =
1390 const bool isIdenticalEvents =
1391 picked_events[first] == picked_events[second];
1393 if (!isRandomStockEvents && isIdenticalEvents) {
1394 picked_events.erase(picked_events.begin() + second);
1398 const bool areMutuallyExclusiveEvents =
1399 std::find(mut_excl_map[picked_events[first].event_id].begin(),
1400 mut_excl_map[picked_events[first].event_id].end(),
1401 picked_events[second].event_id) !=
1402 mut_excl_map[picked_events[first].event_id].end();
1404 if (areMutuallyExclusiveEvents) {
1405 picked_events.erase(picked_events.begin() + second);
1413 return picked_events;
1441 std::vector<Stock_event> picked_events = {
1442 craftedEvent, craftedEvent_2, craftedEvent_3};
1443 std::vector<Stock_event> uniqEvents =
uniq_events(picked_events, picked_events);
1445 std::cout << uniqEvents.size() << std::endl;
1446 if (!(uniqEvents.size() == 2)) {
1447 std::cout << uniqEvents.size() << std::endl;
1449 "Detected duplicate/mutually-exclusive events after uniq_events()");
1458 " has rised too high and the company has decide a stock split on it.",
mutuallyExclusiveMap build_mutual_exclusivity_map(const std::vector< Stock_event > &all_events)
void print_map(const std::map< unsigned int, std::vector< unsigned int > > &map)
Print a map to std::cout.
std::vector< Stock_event > uniq_events(std::vector< Stock_event > picked_events, const std::vector< Stock_event > &all_events)
Filter out the events that are mutually exclusive with each other, or events that are identical (exce...
Stock_event getStockSplitEvent(void)
const std::vector< Stock_event > all_stock_events
The list of all events that can be applied to the stocks.
bool assertion_check_mutual_exclusivity(void)
Check if there are mutual exclusivity violations in all_stock_events.
mutuallyExclusiveMap check_mutual_exclusivity(const std::vector< Stock_event > &all_events)
If A is mutually exclusive with B, then B is mutually exclusive with A.
std::vector< Stock_event > pick_events(const std::vector< Stock_event > &all_events, unsigned int num_events)
Pick a random event from the list of events.
void assertion_check_uniq_events(void)
Implements event-related data structures and (declarations of) such functions.
std::map< decltype(Stock_event::event_id), std::vector< decltype(Stock_event::event_id)> > mutuallyExclusiveMap
@ upper_limit
The upper limit of the stock price percentage change.
@ standard_deviation
Amount of variation of the stock price percentage change.
@ mean
The expectation of the stock price percentage change.
@ lower_limit
The lower limit of the stock price percentage change.
@ pick_random_stock
This event will apply to a randomly selected stock from all of the stocks available currently.
@ category
This event will apply to stocks within the specified category.
@ all_stocks
This event will apply to all stocks.
unsigned int random_integer(unsigned int max_integer)
python randint like function
Header file for random related functions.
The data structure of an event that will be applied to the stocks.