Create Account

Simon T Schedule Editor Tool
#1
(This post was last modified: 03-29-2019, 02:58 AM by Gray.)

After @"luketd"'s post about how to set up the Simon T Hockey Simulator I've been messing around, trying different stats to see what works the best. I quickly realized simulating a large number of games can take a bit of time and I was simulating all these games I didn't even care about. So I made this tool that will remove all games that the specified team isn't playing in. Hopefully, something like this doesn't already exist, but it was a good learning experience either way. Unfortunately, it only works on windows (I think) as I don't really know how to make stuff for Mac. Sorry!

If you don't know how to get the simulator setup you can look at Luke's post HERE.

How to use it:

Step 1: Create your schedule with however many games you want.

[Image: 9GBWbeV.png]

Step 2: Export your schedule.

[Image: m2uUpaS.png]

[Image: yFjkSIB.png]

Step 3: Make sure you name the exported file "ProSchedule" and put it into the same directory as the schedule editor.

[Image: McuAIrK.png]

Step 4: Run the executable and enter the name of the team you want to simulate. This name has to be exact, capitals, spaces and whatever else.

[Image: bAW0x1S.png]

You can also choose the show the output after this which was mostly used by me to make sure everything was working, but you can show it if you want to see what's going on.

Once it's finished running - which should only take a second - you should have a file called "EditedProSchedule" in the same directory.

Step 5: Import the new schedule making sure to check the box that allows teams to play a different number of games.

[Image: wXfjCvU.png]

And you're done! This should also work with the SHL as I think everything is done the same way? Never tested it though so I don't know. If you find anything that doesn't work or want something added let me know and I'll try to do it.

Also, I know a random exe can be kinda sketchy so I can upload the source code somewhere or do something else if someone wants... but it is legit, I promise I won't hurt your computer.

Edit: Just posted the code here so it is less sketch.

Code:
#include "stdafx.h"

#include <iostream>
#include <fstream>
#include <vector>
#include <sstream>
#include <string>

using namespace std;


void EditSchedule(string teamName, bool showOutput)
{
    int day = 1;

    fstream fin, fout;

    fin.open("ProSchedule.csv", ios::in);

    fout.open("EditedProSchedule.csv", ios::out);

    fout << "Day,Visitor Team,Home Team\n";

    string line, word;
    vector<string> row;

    while (!fin.eof())
    {
        row.clear();
        getline(fin, line);
        stringstream s(line);

        if (showOutput)
            cout << line;

        while (getline(s, word, ','))
        {
            row.push_back(word);
        }

        if (row.size() == 3)
        {
            if (row[1] == teamName || row[2] == teamName)
            {
                if (showOutput)
                    cout << " - True" << endl;

                fout << day << ", ";
                fout << row[1] << ", ";
                fout << row[2] << "\n";

                day++;
            }
            else if (showOutput)
            {
                cout << " - False" << endl;
            }
        }
    }

    fin.close();
    fout.close();
}

int main()
{
    cout << "Make sure your file is called 'ProSchedule.csv' and in the same directory as this file." << endl;

    string teamName;

    cout << "Enter the name of the team you wish to keep games for. Must be exact. Example: 'Vancouver Whalers'" << endl;
    getline(cin, teamName);

    string input;

    cout << endl << "Show output? 'y' or 'n'. Not showing output can be faster if you have thousands of games." << endl;
    cin >> input;

    bool showOutput = false;

    if (input == "y")
    {
        showOutput = true;
    }

    EditSchedule(teamName, showOutput);

    cout << "Done! Look for 'EditedProSchedule.csv' for your new schedule." << endl;

    system("pause");

    return 0;
}



[Image: grayhd.gif]

[Image: YztPk3T.png] [Image: 6by0kBi.png]
Reply
#2

largest nerd army in the league Whalers

Player info | Updates | Stats
SteelhawksCanadaWhalers

[Image: aawil.gif]
Reply
#3

I did this before when I was simmer. It broke the index to where we had no leaderboards or team scoring visible. The schedule editor is garbage and just breaks the sim.

An old man's dream ended. A young man's vision of the future opened wide. Young men have visions, old men have dreams. But the place for old men to dream is beside the fire.
[Image: DOF5tXM.png]
[Image: tjyuut.jpg] 
Thanks to Jackson, Copenhagen, and Harry Hans!

GOING DOWN IN STYLE. TOAST4LYFE
Reply
#4

03-29-2019, 07:39 AMJayWhy Wrote: I did this before when I was simmer. It broke the index to where we had no leaderboards or team scoring visible. The schedule editor is garbage and just breaks the sim.

I mean this works perfectly fine for its intended purpose. If you want to test different builds for your player or different lines for your team you can remove the games you wouldn't care about anyways and save some time.

[Image: grayhd.gif]

[Image: YztPk3T.png] [Image: 6by0kBi.png]
Reply
#5

its easier to import a CSV file, doesnt screw with the index either

[Image: x17WALp.png]||[Image: uNh8ZtE.png]
[Image: luff.png][Image: luff2.png][Image: luff.png]
Reply




Users browsing this thread:
1 Guest(s)




Navigation

 

Extra Menu

 

About us

The Simulation Hockey League is a free online forums based sim league where you create your own fantasy hockey player. Join today and create your player, become a GM, get drafted, sign contracts, make trades and compete against hundreds of players from around the world.