Giter VIP home page Giter VIP logo

Comments (6)

mballance avatar mballance commented on June 6, 2024

Good catch, @ShraddhaDevaiya. I supported range specification as tuples, but not the vsc.rng format. Release 0.1.7 contains support for specifying weight ranges using vsc.rng.

Best Regards,
Matthew

from pyvsc.

ShraddhaDevaiya avatar ShraddhaDevaiya commented on June 6, 2024

Hi @mballance , still it is giving me an error with this code. Can you please show me an example?

Thanks & Regards,
Shraddha Devaiya.

from pyvsc.

mballance avatar mballance commented on June 6, 2024

Of course. Here's a link to the test I created from your example:

def test_dist_array_elems_range(self):
class my_e(Enum):
A = 0
B = auto()
C = auto()
D = auto()
@vsc.randobj
class my_c(object):
def __init__(self):
self.a = vsc.rand_enum_t(my_e)
#self.a = vsc.rand_list_t(vsc.bit_t(7),15)
#self.a = vsc.rand_uint8_t()
@vsc.constraint
def dist_a(self):
#with vsc.foreach(self.a, idx=True) as i:
vsc.dist(self.a, [ vsc.weight(vsc.rng(my_e.A, my_e.C),10), vsc.weight(my_e.D, 20)])
my = my_c()
# Randomize
for i in range(10):
my.randomize()
print("MY ITEM : ",i+1)
print(my.a)

I'll reopen this for now until we're able to confirm that it's been resolved.

Best Regards,
Matthew

from pyvsc.

ShraddhaDevaiya avatar ShraddhaDevaiya commented on June 6, 2024

Hi, @mballance , Sorry for the delay.
One thing I have observed in this code. With randomization , it is only giving my_e.C and my_e.D. I have run this 15 times, but it is just giving these two values. Just wanted to confirm, is this the same behavior at your end ? means my_e.B and my_e.A are not coming, but it is included in range.

from pyvsc.

mballance avatar mballance commented on June 6, 2024

Hi @ShraddhaDevaiya,
Ah... I can see the issue. I believe the issue is now resolved in 0.1.8, and all values will be produced (subject to weighting, of course). Please confirm that you see the same.

Thanks and Regards,
Matthew

from pyvsc.

ShraddhaDevaiya avatar ShraddhaDevaiya commented on June 6, 2024

Yeah now it is working !

Thanks & Regards,
Shraddha Devaiya.

from pyvsc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.