lp:fortune/products
- Get this branch:
- bzr branch lp:fortune/products
Branch merges
Branch information
Recent revisions
- 18. By Yassine Chaouche <email address hidden>
-
- Added a third strategy using some sort of state machines.
- Moved documentaton files to doc/ - 17. By Yassine Chaouche <email address hidden>
-
Added two strategy players in new Autopilot directory.
So far, strategy1 player is doing better that strategy2. - 16. By Yassine Chaouche <email address hidden>
-
First attempt at implementing spices and land as products (plugins)
- 15. By Yassine Chaouche <email address hidden>
-
Moved colorize from fortune.py (main file) to utils.py where it should belong.
- 12. By Yassine Chaouche <email address hidden>
-
* Added legends to plots
* Plot labels are inclined 30° for better spacing
* Charts are stored in specific Reports directory, created for the purpose.In utils.py
===========- Added a new create_
label(product_ name,x, y) method
- Chanted add_plot accordingly - 11. By Yassine Chaouche <email address hidden>
-
Improved the plotting feature :
- Every product has its own plot
- Two plots per page
- Multiple pages possibleAPI Changes
The main API of Plotter now is :
- Plotter.plot (product_name,price_ list) instead of Plotter. add_plot( product_ name,price_ list)
- Plotter.show() didn't changeutils.Plotter internal changes:
- init_line_chart becomes create_
linechart( pricelist) . It automatically creates a linechart, positions it correctly in the upper or the bottom of self.drawing, fills its data and categoryNames. - save saves the canvas, not the drawing. This allows for multiple pages documents.
- add_line becomes plot. it creates a linechart and adds it to the drawing
- extract_data now returns a formatted version of periods, with lots of empty values to accomodate space.
- show now calls only two methods : save and open.
- some extra methods : format_periods, add_plot, create_drawing
- some extra attributes : self.nb_of_plots
- some attributes aren't needed anymore : data, prodcuts, colors, linechart - 10. By Yassine Chaouche <email address hidden>
-
* added a preliminary show history/
progression/ variations/ chart/plot (all aliases) function : for now it only shows progression of prices for the products in one chart, but in the future each product will have its own chart. Changes in fortune.py
- Added a new period attribute for Game (period = season + year)
- do_show accepts new arguments (all aliases) : history/progression/ variations/ chart/plot
- Stock now has its own History instance for tracking price changes records
- Stock.add_item and Market.variate_ price have been modified to accomodate price changes tracking in History
- new Stock.show_variation( ) method which opens a PDF containing the line charts.
- Added a new History class, used by Stock, which has 3 methods, two of which are used for the moment : add_price and get_prices. The unused one is get_item_pricesChanges in utils.py
new Plotter class, which takes a period at init time but must be fed with successve calls to add_line(product_ name,price_ list). The two exposed methods of Plotter is add_line and show(). All other methods are used internally (and thus should be underscored...) - 9. By Yassine Chaouche <email address hidden>
-
* Bugfix : program crashes if player tries to sell a product that is not available in the market anymore.
This bug was resolved by overloading the remove_item method in wealth.
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)