VerifAI is a software toolkit for the formal design and analysis of systems that include artificial intelligence (AI) and machine learning (ML) components.
BSD 3-Clause "New" or "Revised" License
170
stars
47
forks
source link
Fix ScenicSampler with more than 10 objects (again) #54
Fixes another problem with the ScenicSampler when the scenario has more than 10 objects (the change in 6b602a74f42589558af144113d52b0d14a609729 did not completely solve the problem, and in fact the test I wrote in that commit was wrong).
I also clarified in the documentation that you shouldn't assume anything about the order of sub-domains in a Struct. Unfortunately my previous test did make such an assumption, and there may be code out there which does likewise. If you have a sample from the ScenicSampler, you cannot assume that iterating over sample.objects yields the objects in the same order as in the corresponding Scenic Scene. Instead, you should access the 5th object in the Scene with code like sample.objects.object5, or to be future-proof, like getattr(sample.objects, ScenicSampler.nameForObject(5)).
I've bumped the patch version number so we can make a bugfix release.
Fixes another problem with the
ScenicSampler
when the scenario has more than 10 objects (the change in 6b602a74f42589558af144113d52b0d14a609729 did not completely solve the problem, and in fact the test I wrote in that commit was wrong).I also clarified in the documentation that you shouldn't assume anything about the order of sub-domains in a
Struct
. Unfortunately my previous test did make such an assumption, and there may be code out there which does likewise. If you have asample
from theScenicSampler
, you cannot assume that iterating oversample.objects
yields the objects in the same order as in the corresponding ScenicScene
. Instead, you should access the 5th object in theScene
with code likesample.objects.object5
, or to be future-proof, likegetattr(sample.objects, ScenicSampler.nameForObject(5))
.I've bumped the patch version number so we can make a bugfix release.