Class: Bouquet

Bouquet(id, name, price, image, flowers, mainColoropt, seasonopt)

Class representing a Bouquet, a collection of flowers.

Constructor

new Bouquet(id, name, price, image, flowers, mainColoropt, seasonopt)

Creates a Bouquet instance.

Parameters:
Name Type Attributes Default Description
id number

ID.

name string

Name.

price number

Price.

image string

Image path.

flowers Array.<Flower>

Array of Flower objects in the bouquet.

mainColor string <optional>
'Mixed'

The dominant color.

season string <optional>
'All-Year'

Seasonality.

Source:

Extends

Classes

Bouquet
ShopItem

Methods

findOptimalFlowerConnections(graph, algorithmNameopt) → {Object}

Finds the Optimal Flower Connections using an MST algorithm (Kruskal or Prim).

Parameters:
Name Type Attributes Default Description
graph Graph

The master graph of all flower compatibilities.

algorithmName string <optional>
'Kruskal'

The algorithm name ('Kruskal' or 'Prim').

Source:
Returns:

An object containing the MST results: { mst: Array, weight: number, algorithm: string }.

Type
Object

(abstract) getDescription() → {string}

Gets a general description of the item (Polymorphic method).

Overrides:
Source:
Returns:

The item description.

Type
string

getId() → {number}

Gets the unique ID of the item.

Overrides:
Source:
Returns:

The item's ID.

Type
number

isPricy() → {boolean}

Checks if the item is expensive (price > 100).

Overrides:
Source:
Returns:

True if the price is above 100.

Type
boolean