Page 3 of 3 FirstFirst 1 2 3
Results 21 to 27 of 27

Thread: vcon - Veracity's consumable library

  1. #21
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    13,177

    Default

    Revision 118 excludes the following from consideration:

    extra-greasy slider
    jar of fermented pickle juice

    Your autoByPriceLimit would have to be high for them to be considered, and if your Meat per Adventure is high enough, I suppose they could be cost-effective, but since they each have the side effect of cleaning 5 spleen, they seem like they are situationally useful for manual usage, not simply because of their adventure yield.

  2. #22
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    13,177

    Default

    And revision 119 allows you to configure your own set of consumable items

    // If you want to exclude specific items from consideration, add them here.
    // For example, to exclude Hobopolis consumables:
    //
    // set VCON.ExcludedConsumables=frozen banguet|Hodgman's blanket|Tin cup of mulligan stew

    item_set user_excluded_consumables = define_property( "VCON.ExcludedConsumables", "item", "", "set" ).to_set_of_item();

  3. #23
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    13,177

    Default

    I'm going to take a look at xkiv's post to see if I can come up with an optimal organ-filling algorithm. I have a decent algorithm in VMF which I now use for food and spleen, but how about a general algorithm which will work on any "best" map (food, booze, spleen) and an "available" size which returns a collection of the item/quantities which, in total, gives the optimal expected adventure gain?

    Code:
    best_found_diet=[]; // dynamic array
    for (i=1; i<= organ_size; i++) {
      best_found_diet[i] = [ vcon_best_foods[i] ];
    }
    for (i=1; i<= organ_size; i++) {
      for (j=1; j<i; j++) {
        // how do you concatenate arrays in ASH, again?
        combined_diet = best_found_diet[j] + best_found_diet[i-j]; // try beating the single food item of size i by eating multiple smaller foods
        if (profit(combined_diet) > profit(best_found_diet[i])) {
          best_found_diet[i] = combined_diet;
        }
      }
    }
    In other words, put the calculation into vcon, rather than having the users of vcon have to do (similar) calculations themselves.

  4. #24
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    13,177

    Default

    I coded this up. vct.ash (vcon test):

    Code:
    import <vcon.ash>;
    
    if ( count( vcon_best_boozes ) == 0 ) {
        calculate_best_boozes( vcon_mpa() );
    }
    
    consumable_diet diet = calculate_diet( vcon_best_boozes, 20 );
    
    print( " " );
    print( "vcon recommends the following 20-fullness diet:" );
    print( " " );
    
    foreach index, c in diet {
        print( c.it + " (" + c.profit + " profit)" );
    }
    
    print( "Done!" );
    where calculate_diet is:

    Code:
    consumable_diet calculate_diet( consumables_by_size candidates, int capacity )
    {
        consumable_diet concatenate( consumable_diet... diets )
        {
    	consumable_diet combined;
    	foreach i, diet in diets {
    	    foreach i, c in diet {
    		combined[ combined.count() ] = c;
    	    }
    	}
    	return combined;
        }
    
        int profit( consumable_diet diet )
        {
    	int meat = 0;
    	foreach i, c in diet {
    	    meat += c.profit;
    	}
    	return meat;
        }
    
        void print_diet( consumable_diet diet )
        {
    	foreach index, c in diet {
    	    print( c.it + " (" + c.profit + " profit)" );
    	}
        }
    
        // An array of best diets from 1 to capacity
        consumable_diet[ int ] diets;
    
        // Preload it with the best consumables
        for ( int i = 1; i <= capacity; i++ ) {
    	diets[ i ] = { candidates[ i ] };
        }
    
        foreach i, diet in diets {
    	print( "Best diet for size " + i );
    	print_diet( diet );
        }
    
        for ( int i = 1; i <= capacity; i++ ) {
    	for ( int j = 1; j < i; j++ ) {
    	    consumable_diet combined = concatenate( diets[ j ], diets[ i - j ] );
    	    if ( combined.profit() > diets[ i ].profit() ) {
    		diets[ i ] = combined;
    	    }
    	}
        }
    
        foreach i, diet in diets {
    	print( "Best diet for size " + i + " (" + diet.profit() + " profit)" );
    	print_diet( diet );
        }
    
        return diets[ capacity ];
    }
    Yields (removing the output from calculate_best_boozes):

    Code:
    Best diet for size 1
    elemental caipiroska (23926 profit)
    Best diet for size 2
    Sangria de Menthe (44180 profit)
    Best diet for size 3
    perfect mimosa (73038 profit)
    Best diet for size 4
    hacked gibson (81641 profit)
    Best diet for size 5
    none (0 profit)
    Best diet for size 6
    space wine (81543 profit)
    Best diet for size 7
    none (0 profit)
    Best diet for size 8
    none (0 profit)
    Best diet for size 9
    none (0 profit)
    Best diet for size 10
    none (0 profit)
    Best diet for size 11
    none (0 profit)
    Best diet for size 12
    none (0 profit)
    Best diet for size 13
    none (0 profit)
    Best diet for size 14
    none (0 profit)
    Best diet for size 15
    none (0 profit)
    Best diet for size 16
    none (0 profit)
    Best diet for size 17
    none (0 profit)
    Best diet for size 18
    none (0 profit)
    Best diet for size 19
    none (0 profit)
    Best diet for size 20
    none (0 profit)
    Best diet for size 1 (23926 profit)
    elemental caipiroska (23926 profit)
    Best diet for size 2 (47852 profit)
    elemental caipiroska (23926 profit)
    elemental caipiroska (23926 profit)
    Best diet for size 3 (73038 profit)
    perfect mimosa (73038 profit)
    Best diet for size 4 (96964 profit)
    elemental caipiroska (23926 profit)
    perfect mimosa (73038 profit)
    Best diet for size 5 (120890 profit)
    elemental caipiroska (23926 profit)
    elemental caipiroska (23926 profit)
    perfect mimosa (73038 profit)
    Best diet for size 6 (146076 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    Best diet for size 7 (170002 profit)
    elemental caipiroska (23926 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    Best diet for size 8 (193928 profit)
    elemental caipiroska (23926 profit)
    elemental caipiroska (23926 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    Best diet for size 9 (219114 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    Best diet for size 10 (243040 profit)
    elemental caipiroska (23926 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    Best diet for size 11 (266966 profit)
    elemental caipiroska (23926 profit)
    elemental caipiroska (23926 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    Best diet for size 12 (292152 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    Best diet for size 13 (316078 profit)
    elemental caipiroska (23926 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    Best diet for size 14 (340004 profit)
    elemental caipiroska (23926 profit)
    elemental caipiroska (23926 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    Best diet for size 15 (365190 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    Best diet for size 16 (389116 profit)
    elemental caipiroska (23926 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    Best diet for size 17 (413042 profit)
    elemental caipiroska (23926 profit)
    elemental caipiroska (23926 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    Best diet for size 18 (438228 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    Best diet for size 19 (462154 profit)
    elemental caipiroska (23926 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    Best diet for size 20 (486080 profit)
    elemental caipiroska (23926 profit)
    elemental caipiroska (23926 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    
    vcon recommends the following 20-fullness diet:
    
    elemental caipiroska (23926 profit)
    elemental caipiroska (23926 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    perfect mimosa (73038 profit)
    Done!
    I'll remove the excess logging and will submit this and then try using it in VMF.

  5. #25
    Senior Member
    Join Date
    Feb 2010
    Posts
    1,144

    Default

    I realize that this suite of scripts is designed for use in aftercore but thought I'd ask...would you entertain the idea of allowing vcon to "work" in-run and consider food only from available sources?

  6. #26
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,674

    Default

    I realize that this suite of scripts is designed for use in aftercore but thought I'd ask...would you entertain the idea of allowing vcon to "work" in-run and consider food only from available sources?
    Originally Posted by Magus_Prime View Post
    I too would be interested in VCON as an EatDrink replacement although my recollection is that I was able to do that with the earlier algorithm and so I expect I could do it now, as well.

    Tangentially, that said, I would find fighting the tentacle, the NEP, if available, and using VMF to max the still all of interest in run. I have experimented with importing and had some success but last time I tried there were things with outfits that I chose not to resolve. As I recall, the script would use an outfit but the saved outfit of the name could not be equipped in run for any one of several reasons. Since the "best" outfit tends to vary between freeing the king and level 15, or so, and I tend to stash a lot of useful gear in my display case, my personal solution is going to be a script that pulls potentially useful items from the DC, runs the maximizer and then saves the outfit with the appropriate names. But I have not written that yet :-)
    Well, thank you.
    Originally Posted by Veracity View Post

  7. #27
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    13,177

    Default

    vcon didn't have an "algorithm" for calculating whole diets before. It calculated "most profitable" food of each size and VMF used that to decide what to consume of various sizes, starting from the largest and considering smaller and smaller foods until you were full.

    vcon's current diet calculation recognizes that, say, 2 1-size consumables might be better than 1 2-size consumable and calculates the whole diet.

    It's aftercore because:

    1) It considers all awesome and EPIC foods
    2) It maximizes adventures using "profitable" foods - the expected Meat return must be positive
    3) It considers mall prices to decide whether it is profitable.
    4) It finds a single best food of each size and uses that

    Your diet might be 3 (of the same) size-4 foods and a size-3 food.

    An in-run algorithm would need:

    1) Consider all foods you have on hand.
    2) It wants to maximize adventures; mall price is not a consideration
    3) Should it consider storage for Nomal runs? A pull budget would complicate this a lot, I think.
    4) For inventory-only, you might have multiple size-n foods with different yields and want to use more than 1 kind.

    Your diet might be 3 different size-4 foods (that you have 1 each of) and a size-3 food.

    It's an interesting problem, but perhaps would better to make a new library. An in-run-vcon, or something.

Posting Permissions

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