Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ch 2 - Performance measures #130

Open
Dragneel7 opened this issue Dec 17, 2017 · 5 comments
Open

Ch 2 - Performance measures #130

Dragneel7 opened this issue Dec 17, 2017 · 5 comments
Labels
improvement Improve an existing visualization

Comments

@Dragneel7
Copy link
Contributor

Dragneel7 commented Dec 17, 2017

TODO: dirty/clean should be controlled automatically, reproducible using seeded RNG, and then display a line chart with the performance measure.

We can add the following feature by creating 2 types of agents:
1.) agent that moves continuously but takes up more time to clean
2.) agent that stops after regular intervals but takes less time to clean

We can either use a 1x2 floor or 2x2 floor to make the problem more complex.
Things to be decided before implementing:-
1.)Points awarded for each successful clean
2.)Points deducted for each extra moment
3.)Points deducted on the basis for the time the floor is dirty (a negative factor to agent 2)

The performance will be shown as a line chart of scores v/s time where scores measure the performance of the agent.
To make it more interactive and intuitive, the feature of setting the stop-interval and the cleaning-interval
to show various performances.
@redblobgames Would it be useful to implement it?
Would like to work on it: Yes.

@redblobgames
Copy link
Contributor

Sure, that could be cool. Here's a reproducible seeded RNG if you need one:

function makeRand(seed) {
    const multiplier = 47271;
    const wrap = 0x7FFFFFFF;
    seed = seed % wrap;
    if (typeof seed != 'number' || !(seed > 0)) throw "check seed to makeRandInt";
    return function() {
        seed = seed * multiplier % wrap;
        return seed;
    };
}
    
function makeRandInt(seed) {
    let generator = makeRand(seed);
    return (N) => generator() % N;
}

You may also find some ideas useful from Ladder of Abstraction

@Dragneel7
Copy link
Contributor Author

Thanks, I'll start working upon the idea.

@Dragneel7
Copy link
Contributor Author

I am facing a little problem while implementing agent2, i want to the agent2 to run for a while, then stop for a time period and then run again continuing this cycle.
How should I do this?

@redblobgames
Copy link
Contributor

The way the agents are programmed now may not be flexible enough for what you want. Feel free to implement them in a different way to make your diagram work. The implementation does not have to match the book's examples (the book's pseudocode is not designed with visualizations in mind).

@Dragneel7
Copy link
Contributor Author

Dragneel7 commented Mar 3, 2018

Hi , I had worked upon this visualization. The code works as desired. but as you pointed out here is a design doc for the same. @redblobgames @samuelgoto Please review.
Thanks

@redblobgames redblobgames changed the title Ch2 - Performance measures Ch 2 - Performance measures Feb 5, 2019
@redblobgames redblobgames added the improvement Improve an existing visualization label Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improve an existing visualization
Projects
None yet
Development

No branches or pull requests

2 participants