Class: CwCardUtils::DeckComparator
- Inherits:
-
Object
- Object
- CwCardUtils::DeckComparator
- Defined in:
- lib/cw_card_utils/deck_comparator.rb
Constant Summary collapse
- WEIGHTS =
{ archetype: 0.30, curve: 0.25, synergy: 0.25, interaction: 0.20, }.freeze
Instance Attribute Summary collapse
-
#analysis ⇒ Object
readonly
Returns the value of attribute analysis.
-
#deck_a ⇒ Object
readonly
Returns the value of attribute deck_a.
-
#deck_b ⇒ Object
readonly
Returns the value of attribute deck_b.
Instance Method Summary collapse
-
#compare ⇒ Hash
Public: Compare decks for on-play and on-draw scenarios.
-
#initialize(deck_a, deck_b) ⇒ void
constructor
Public: Create a comparator for two decks.
Constructor Details
#initialize(deck_a, deck_b) ⇒ void
Public: Create a comparator for two decks. 日本語: 2つのデッキを対象にコンパレータを作成します。
23 24 25 26 27 |
# File 'lib/cw_card_utils/deck_comparator.rb', line 23 def initialize(deck_a, deck_b) @deck_a = deck_a @deck_b = deck_b @analysis = {} end |
Instance Attribute Details
#analysis ⇒ Object (readonly)
Returns the value of attribute analysis.
8 9 10 |
# File 'lib/cw_card_utils/deck_comparator.rb', line 8 def analysis @analysis end |
#deck_a ⇒ Object (readonly)
Returns the value of attribute deck_a.
8 9 10 |
# File 'lib/cw_card_utils/deck_comparator.rb', line 8 def deck_a @deck_a end |
#deck_b ⇒ Object (readonly)
Returns the value of attribute deck_b.
8 9 10 |
# File 'lib/cw_card_utils/deck_comparator.rb', line 8 def deck_b @deck_b end |
Instance Method Details
#compare ⇒ Hash
Public: Compare decks for on-play and on-draw scenarios. 日本語: 先手/後手の両シナリオで比較します。
Intent (EN): Produces two analyses (on the play / on the draw) combining archetype, curve segmentation, synergy hit-rate, and interaction density. A weighted heuristic yields Deck A’s win rate and a favored label, plus explanatory notes.
意図 (JA): アーキタイプ、カーブ分割、シナジー成立率、インタラクション密度を統合し、先手/後手の 2 通りの分析を生成します。重み付きヒューリスティックによりデッキAの勝率と有利側のラベルを算出し、説明的なノートを付与します。
43 44 45 46 47 48 49 |
# File 'lib/cw_card_utils/deck_comparator.rb', line 43 def compare results = { on_play: matchup_scenario(on_play: true), on_draw: matchup_scenario(on_play: false), } @analysis = results end |