Skip Menu |

This queue is for tickets about the Quantum-Superpositions CPAN distribution.

Report information
The Basics
Id: 73655
Status: open
Priority: 0/
Queue: Quantum-Superpositions

People
Owner: Nobody in particular
Requestors: perl [...] toby.ink
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Weighted superposition
A weighted superposition would be the same as an "any" superposition, except that not all possibilities would be equally likely... $unfair_dice_1 = weighted( 1 => 4, # value => weighting 2 => 1, 3 => 1, 4 => 1, 5 => 1, 6 => 1, ); $unfair_dice_2 = weighted( 1 => 3, 2 => 1, 3 => 2, 4 => 1, 5 => 1, 6 => 1, ); $total = $unfair_dice_1 + $unfair_dice_2; I'd be happy to provide a patch for this feature, if it would be likely to be accepted.
CC: lembark [...] wrkhors.com
Subject: Re: [rt.cpan.org #73655] Weighted superposition
Date: Sun, 1 Jan 2012 17:48:27 -0600
To: bug-Quantum-Superpositions [...] rt.cpan.org
From: Steven Lembark <lembark [...] wrkhors.com>
On Sun, 1 Jan 2012 14:35:04 -0500 "Toby Inkster via RT" <bug-Quantum-Superpositions@rt.cpan.org> wrote: Show quoted text
> Sun Jan 01 14:35:03 2012: Request 73655 was acted upon. > Transaction: Ticket created by TOBYINK > Queue: Quantum-Superpositions > Subject: Weighted superposition > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: mail@tobyinkster.co.uk > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=73655 > > > > A weighted superposition would be the same as an "any" superposition, > except that not all possibilities would be equally likely... > > $unfair_dice_1 = weighted( > 1 => 4, # value => weighting > 2 => 1, > 3 => 1, > 4 => 1, > 5 => 1, > 6 => 1, > ); > $unfair_dice_2 = weighted( > 1 => 3, > 2 => 1, > 3 => 2, > 4 => 1, > 5 => 1, > 6 => 1, > ); > $total = $unfair_dice_1 + $unfair_dice_2; > > I'd be happy to provide a patch for this feature, if it would be likely > to be accepted.
Q1: Have you actually looked at the source for Q::S? Especially the part below "No user servicable code below this line"? If so, and you actually have time to work on this at all, I can send you the current version of the code. The newer version replaces all of the multimethods with a simpler, fixed dispatch and should actually make the thing usable in real life. I just havn't had time to finish it over the past few years. -- Steven Lembark 3646 Flora Pl Workhorse Computing St Louis, MO 63110 lembark@wrkhors.com +1 888 359 3508
On 2012-01-01T23:43:46Z, lembark@wrkhors.com wrote: Show quoted text
> Q1: Have you actually looked at the source for Q::S? > Especially the part below "No user servicable code > below this line"?
Yes - while it doesn't look easy to hack on, it's probably less work than writing a weighted superposition module from scratch.
On 2012-01-01T23:43:46Z, lembark@wrkhors.com wrote: Show quoted text
> Q1: Have you actually looked at the source for Q::S? > Especially the part below "No user servicable code > below this line"?
PS: I don't think that comment actually appears anywhere in the source code. (Though if it did, it should probably be somewhere near the top.)