Results 1 to 3 of 3

Thread: JavaScript code for a draft simulation involving 1 user and 11 automated bidders

  1. #1
    Join Date
    Feb 2012

    JavaScript code for a draft simulation involving 1 user and 11 automated bidders

    So I have 12 employees about ready to place bids on projects at work... and we will be drawing names out of a hat, 1-12.

    What I am looking for is code to construct a simulator that will help the user run through scenarios of bidding on projects at work.

    For example, everyone will draw a name out of a hat (numbers 1-12). The first person gets to call dibs on the first work project of choice (let's say the most fun)... this will not be the tool used to actually select or submit request, I merely want a "simulator" everyone can use (via javascript) so that all 12 people can simulate what "projects" will be available at certain bidding slots... So when this tool is used, it's basically the person using the simulation vs. 11 other "automated" bidders... and those automated slots will just bid off of a list (that I can manage and reorder via values I have based on popularity)....

    So, the definitions for the code:

    1. So the user, who will be bidding by himself against automated bidders, will select their bid slot (1-12) at the very beginning, to prepare for whatever pick they eventually get out of the hat.
    2. Whatever pick or slot the user selects, they will have the opposite pick in the following round, but then back to their original slotting in the 3rd, then the opposite in the 4th again, and so on, so a snake-like bidding pattern. So ex: a person selects to bid from the 1st spot would have slots: 1, 24, 25, 36, 48, 49, etc..
    3. When the user is up (ex: they pick the 1st slot, they are up right away), the user will have a drop down list of all available jobs (not yet selected), then they will have a "select" button they can hit that will insert their selection into the running bid list
    4. After the user hits select, all automated bid slots will be instantly filled in (using the running list in order that the running list is constructed (that I could change whenever, like if we kill a project and create a new one)... so essentially, the user is always "on the spot" to make their bid, cause auto picks will instantly fill in up to the point that the user is up again right away.
    5. For automated bidders will immediately fill in using the running list as the source to select and in what order... as projects are selected, these projects vanish from the drop down list to select from
    6. So, essentially, each time the user of this tool selects the project (When their bid is up), they are immediately back up and ready to bid again because those auto picks are, well, auto and immediate.

    Example of first piece:

    1. What bid slot do you want to simulate from? [ select 1-12 ]

    After selection is selected, let's say #4 bid slot is selected:

    2. A draft list will start developing and read something like:

    1.01 - Green Initiative Project - Auto bidder
    1.02 - Thomas Murphy, Jr. Project - Auto bidder
    1.03 - Awaika Project - Auto bidder
    1.04 - YOU ARE UP! BID!
    >> Drop down list [80 projects inside drop down, minus the three above which are gone ] [select button ]

    3. Once the user selects the 4th project, the running draft list will continue to generate the running draft results, and the user will immediately be back up to make their next bid, so after the select button is pressed, it would look like (immediately):

    1.01 - Green Initiative Project - Auto bidder
    1.02 - Thomas Murphy, Jr. Project - Auto bidder
    1.03 - Awaika Project - Auto bidder
    1.04 - Willow Project - (This is you!!!)
    1.05 - d project - Auto bidder
    1.06 - e project - Auto bidder
    1.07 - f project - Auto bidder
    1.08 - g project - Auto bidder
    1.09 - h project - Auto bidder
    1.10 - i project - Auto bidder
    1.11 - j project - Auto bidder
    1.12 - k project - Auto bidder
    2.01 - l Project - Auto bidder
    2.02 - m Project - Auto bidder
    2.03 - n - Auto bidder
    2.04 - o Project - (This is you!!!)
    2.05 - p project - Auto bidder
    2.06 - q project - Auto bidder
    2.07 - r project - Auto bidder
    2.08 - s project - Auto bidder
    1.09 - YOU ARE UP! BID!
    >> Drop down list [63 projects inside drop down, minus the 20 above which are gone ] [select button ]

    For the third round of bidding, the user in this situation would pick at 3.04 (odd rounds are the same slot, and then at 4.09 (even rounds are the same)...

    And so on...

    The drop down list (Which the auto picks would just select from down the line) would again be powered by a master list I could update, and that would look something like:

    Green Initiative Project
    Thomas Murphy, Jr. Project
    Awaika Project
    d project
    e project
    f project
    g project
    h project
    i project
    j project
    k project
    l project
    m project
    n project
    o project
    p project
    q project
    r project
    s project
    t project
    u project
    v project

    * all automated bidders would select the top project first, only the user could deviate from the drop down and alter the order... and again, each time a project gets selected, it is removed from the drop down list, but stays in order of what I rank the projects on the master list...

    I know this is a A LOT to process, and I'm so sorry for the length of this..

    Anyone's help is MUCH appreciated.

    Thank you, and I look forward to anyone's help!!!!!
    Last edited by billybobt; 02-15-2012 at 01:11 AM.

  2. #2
    Join Date
    Nov 2010
    hello again Bob,

    the way I understand it, I'm not entirely sure that javascript is the best language for this. You understand that every time the page is refreshed the "list" will go back to as it was in the beginning, and even that if two users are looking at the page from different locations each will be presented with a separate list and have no idea what is going on with the "master" list or what the other user has done.

    basically, for it to work, all the users will have to sit down at one time, fill out the entire list in one go and then the list will have to be saved elsewhere.

    javascript can be made to interact with a database, but if you're going to be doing that from the start, you might consider a server-side language to do the heavy lifting, with javascript doing what it is supposed to do - facilitate user interactions with a single page.

  3. #3
    Join Date
    Feb 2012
    Ok, php? Thanks in advance!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.16171 seconds
  • Memory Usage 2,859KB
  • Queries Executed 15 (?)
More Information
Template Usage (32):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (3)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates