Please use our links: LEGO.com • Amazon
Recent discussions • Categories • Privacy Policy • Brickset.com
Brickset.com is a participant in the Amazon Services LLC Associates Program, the Amazon.com.ca, Inc. Associates Program and the Amazon EU Associates Programme, which are affiliate advertising programs designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.
As an Amazon Associate we earn from qualifying purchases.
Comments
compensation offered :)
It was initially tricky to get the scripts working with Octave. I has associated *.m files with octave.exe but I double-click them or run them from the commandline, the scripts would complain about files not being defined. From an earlier post, I learned that I need to first run octave and then from within it, 'cd' to the script folder and then run the script. Is there a way to invoke the scripts more directly?
- Go to Wanted List page and click 'Show All'
- Click the printer icon in the upper right
- To get everything on one page, add "&wantedSize=100" to the end of the url and go. Adjust the number to accommodate your list size.
- Save the page as html file
In the html file, the relevant section for each item looks something like this:<A HREF="catalogItem.asp?P=30374">Yellow Bar 4L (Lightsaber Blade / Wand) </A></B></FONT></TD></TR><TR BGCOLOR="#EEEEEE"><TD ALIGN="CENTER"><FONT FACE="Tahoma,Arial" SIZE="2">New</FONT></TD><TD ALIGN="CENTER"><FONT FACE="Tahoma,Arial" SIZE="2">3</FONT>
The following regular expressions seems to be able to find each instance:
<A HREF="catalogItem.asp\?P=[^>]+">[^<]+</A></B></FONT></TD></TR><TR BGCOLOR="#EEEEEE"><TD ALIGN="CENTER"><FONT FACE="Tahoma,Arial" SIZE="2">[^<]+</FONT></TD><TD ALIGN="CENTER"><FONT FACE="Tahoma,Arial" SIZE="2">[^<]+</FONT>
From the above text, it's possible to extract:
ItemID: 30374
ItemName: 4L (Lightsaber Blade / Wand)
ColorName: Yellow
Category: Bar
Qty:3
Condition:New
The most tricky part I think is parsing out the color, category, and name from the single description text. Also tricky is that if a specific color is not requested, the color text will not be in the description. I suppose one can do a substring search of the description field against a table of known colors and a table of known categories. Another possibility is to look at the 'alt' text of the image tag, which has the item description without the color, count the length of that string, and truncate that number of characters from the main string.
<A ID='imgLink0' HREF='/catalogItemPic.asp?P=30374' REL='blcatimg'><IMG ALT="Part No: 30374 Name: Bar 4L (Lightsaber Blade / Wand)" TITLE="Part No: 30374 Name: Bar 4L (Lightsaber Blade / Wand)" BORDER='0' WIDTH='80' HEIGHT='60' SRC='http://img.bricklink.com/P/3/30374.gif' NAME='img0' ID='img0' onError="killImage('img0');">
It's likely that not all fields are really necessary for the minimizer scripts to work. I'm guessing that from the description field, we really just need to extract the color.
Also note that not all brickstore xml fields are available, like categoryID, so the resulting file may not work correctly back in brickstore without some extra work, if that is important to anyone.
I hope this helps.
ItemID
ItemTypeID -> Manually define as 'P' for PART
ColorID - a number from the color ID lookup table
Qty
Condition - N, U, or absent for undefined
Fortunately this information is available in the strings above. I agree that color name parsing might be difficult, but there is a list of color names and their ID numbers in the distribution package (color table.txt).
And it is hard to get motivated on something like that when I do programming for work so coming home and programming more doesn't always excite me.
Should I get MatLab or Octave?
I know nothing about either. The scripts located in the zip is confusing me as well.
This can be run independently from Octave or Matlab but it requires a 400Mb library file to be installed.
atxdad, if you want I can assist in creating this package for those interested. (the 400Mb file is provided on the matworks website, your actual project is only 0.5Mb)
Any ideas?
* define the minimum and maximum number of vendors to use when searching for solutions
Please consider reading the whole README.txt though, as it does contain a lot of useful info, in particular how to efficiently search for a large number of lots (i.e. by combining multiple searches).
I just BL'd the Taj Mahal and it took me 22 vendors plus LEGO replacement parts.
this process doesn't really handle large sets so well. a good strategy is to first look at your wanted list in BL, find all the parts that are only carried by a few vendors in the quantities needed, can be really expensive, or are generally rare, even in partial quanties. look at each store that has the rare part, and find out what other items in the set they also have at reasonable prices. Then order those parts, and add on other needed parts to the same order, as long as the prices are close to what you could get them for overall. keep doing this until all your rare/expensive parts have been ordered, along with the other items from teh same vendor. this will whittle your list down quite a bit, then you can run the remainder through the scripts to find the best combination for the common/cheap parts
How do you locate the correct store? I usually do a search for the store name in Bricklink's "Store Name" search but that often doesn't quite work, so then I use a portion of the name I get from Octave and can usually find the right store. However, sometimes it can't find the store at all. For example, can anyone tell me how to find the store "Bricks-r-Kids"? Thanks
For windows. If it doesnt start, there is a "direct link" link in the top part of the page in small print.
I have it installed now and when I launch the program, a black window shows up with a bunch of white letters, kind of like Windows CMD. I tried tying in RUN_ALL as stated in the readme.txt file, but it didn't work.
Could someone please PM me giving me the extra details and steps to get this up and running?
Thanks!
GNU Octave, version 3.6.1
...
...
octave:1>
So I dragged the zip file to my desktop, unzip it, causing it to make a unzipped folder on my desktop.
I then type in 'pwd', 'cd' and 'dir'. When I press enter after 'dir' I get a list of locations on my computer, for example, desktop, documents, pictures, videos and downloads.
What do I do after that?
Sorry for not being clearer about some of the terminologies, as I had assumed you knew what pwd, cd, and dir are for (just goes to show my ages). Those are "DOS prompt" commands that allows you to 'show your current directory', 'change your current directory', and 'list the content of your current directory'.
You want to 'cd' into the directory of the unzipped folder on your desktop. Let's say that is at:
C:\Documents and Settings\Brandon\Desktop\Bricklink
and 'pwd' shows you are at
C:\Documents and Settings\Brandon
then you would need to
cd Desktop\Bricklink
now if you do 'pwd', you should see
C:\Documents and Settings\Brandon\Desktop\Bricklink
and a 'dir' should list the contents of that folder, including the RUN_ALL.m script.
So after all the steps above, I typed in RUN_ALL and a long list of text started showing up. Whats next? Seems to be all error/warning messages.
EDIT: Just got an error message. :(
On my 8 core system, a 4 vendor 1.0221e+12 combinations search takes 112 minutes. The 5 vendor 4.5443e+14 combination search looks like will take at least 60 days.
I'm going to check the vendor pruning logic to see if it can give me some hints on the rarest items I should remove from my list. Does it make sense to wish for an option to "Show me a combination of x number of vendors that sells the most (but not all) of the items I want"? When the script is going through the combination search, the progress shows percentages. Is that the percentage of the wanted list that the current vendor combination have? I wouldn't mind getting started with a solution for 80% of my shopping list and not have some rare items hold me back.
Here are some tips on setting up octave:
To have octave always start in the directory with the minimization scripts instead of the user folder:
- Edit octave\share\octave\site\m\startup\octaverc
- Find cd(getenv('USERPROFILE')) and add a # in front to comment it out.
- Add a cd(".....") command at the bottom to tell octave to go to a certain directory. You can even have octave go to a network share path (hello server farm...). When using backslash in the path, you must enter it twice \\ because \ by itself has a special meaning.
To start Octave from a batch script. To start Octave and run a command. The 'persist' keeps octave running after the command is completed. The 'braindead' suppresses some warnings. To run Octave on a specific CPU, such as the first core. I like to start the CPU naming count at 0, which makes the later examples less confusing. To run find_minimum_cost_remote(x) commands in separate CPU cores if you have multiprocessor support enabled in the script.ex:
#cd(getenv('USERPROFILE'))
ex:
cd("g:\\bricklink\minimzation_v9")
cd("\\\\192.168.1.100\\h$\\bricklink\\minimization_v9")
Putting this in a batch script and running it when prompted by the main script saves a lot of typing. This example is for a 8 core system where the main script in on core 0 and the rest are on cores 1-7.
- Enable the vendor pruning tools to reduce the vendor space to only those vendors likely to fill your order. You can prune the vendor list to a size that will run in your allotted time.
- The tools can identify the rarest parts on your wanted list; removing those from your list may allow solutions with few vendors.
- BrickLink's Wanted/ByShop list can already help buyers find vendors meeting most of a wanted list. The purpose of my tool is to help find a 100% solution without having to guess which parts are most important to the user.
- The progress reports during runtime show how much of the vendor search space has been examined, not how much of the wanted list has been filled.
Lastly, thanks for posting the helpful instructions for Octave users.
"Index 80: 81 of 341, 23.75%
error: mxvendorsearchloop: Out of memory."
Thanks