Open Jannetty opened 22 hours ago
I think a Plane
class definitely makes sense -- I would pop it into core.util
instead, which makes it more clear that it's not a physical thing in the simulation. You can have the Plane
class contain the distance calculation.
A single splitVoxels
function that takes a Plane
instead of Direction
+ the existing Direction
enum returning the corresponding Plane
all sounds good as well. I wouldn't worry about the efficiency at this stage, if you want to make sure, you could do some benchmarking after it is implemented.
Two questions:
getDirection
functionality? Is the idea that there now two main options: (a) split
given only the RNG does the current default behavior of getting the direction based on shorted axis and (b) split
given all parameters lets you specify any possible splitoffsets
parameter be used? Is it captured in the Plane
center point or is it used separately?Thanks Jessica!
getDirection
method. When getDirection
returns a direction, that direction will be used to make a plane (using parameters stored in the Direction enum) and will be passed to the split function with all the parameters (more detailed description of these split functions is below).getOffset
function to get the point when making the plane, and when a plane is not specified the split function can make a plane using getCenter
and enum parameters. So there would exist three split functions:
split(RNG)
: makes plane using getCenter
and getDirection
, passes to split(RNG, Plane, Probability)
split(RNG, Direction)
: makes a plane using getCenter and specified Direction, passes to split(RNG, Plane, Probability)
split(RNG, Plane, Probability)
: Does splittingDoes this seem reasonable?
Yeah, that all sounds great!
Hello all, I am seeking a review on the following proposed design for adding functionality that allows for voxel division along user-specified planes.
Proposed Plan:
Plane
class that storesArrayList<Integer>
of length 3)ArrayList<Integer>
of length 3).splitVoxels
function that takes a plane object as a parameter (instead of a direction) and splits voxels on either side of the plane.split
function that takes a plane object instead of a direction as a parameter. This function will call the above-implementedsplitVoxels
using this plane as a parameter. Planes of division can now be instantiated in agents or in agent modules and passed to thissplit
function.Additional options:
splitVoxels
. This change would let there be only onesplitVoxels
function and would allow all split logic to be contained in onesplit
function rather than having two implementations (one that works with a direction and one that works with a plane). However it could decrease efficiency when dividing along one of the specified planes.Plane
class altogether and, instead of taking Plane objects as parameters, rely on the user to pass a plane's point and normal vector as parameters. I think it makes sense to encapsulate these descriptors in a class, but I also recognize that the plane itself is not an object in the simulation so that may be confusing.Specific feedback I would like:
Plane
class?split
logic andsplitVoxel
functions as described in Additional Option 1? (I can still do that consolidation without a Plane class).Sorry I know this is really nitty gritty but I'm hoping to get some design feedback before I implement. Thank you all!