Package org.robwork.sdurw_pathplanning
Class QSamplerPtr
 java.lang.Object

 org.robwork.sdurw_pathplanning.QSamplerPtr

public class QSamplerPtr extends java.lang.Object
Ptr stores a pointer and optionally takes ownership of the value.


Constructor Summary
Constructors Constructor Description QSamplerPtr()
Default constructor yielding a NULLpointer.QSamplerPtr(long cPtr, boolean cMemoryOwn)
QSamplerPtr(QSampler ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.

Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description QSampler
__ref__()
Dereferencing operator.QSamplerCPtr
cptr()
void
delete()
QSampler
deref()
The pointer stored in the object.boolean
empty()
True if the sampler is known to contain no more
configurations.boolean
equals(QSampler p)
static long
getCPtr(QSamplerPtr obj)
QSampler
getDeref()
Member access operator.boolean
isNull()
checks if the pointer is nullboolean
isShared()
check if this Ptr has shared ownership or none
ownershipQSamplerPtr
make(QIKSamplerPtr sampler, Transform3D target)
A sampler of IK solutions for a specific target.
QSamplerPtr
makeBoxDirectionSampler(PairQ bounds)
Sampler of direction vectors for a box shaped configuration
space.
Each random direction vector is found by sampling a configuration
uniformly at random from bounds, and returning the vector from the
center of the box to the configuration.QSamplerPtr
makeConstrained(QSamplerPtr sampler, QConstraintCPtr constraint)
A sampler filtered by a constraint.
For each call of sample() up to maxAttempts configurations are
extracted from sampler and checked by constraint.QSamplerPtr
makeConstrained(QSamplerPtr sampler, QConstraintCPtr constraint, int maxAttempts)
A sampler filtered by a constraint.
For each call of sample() up to maxAttempts configurations are
extracted from sampler and checked by constraint.QSamplerPtr
makeEmpty()
Empty sampler.QSamplerPtr
makeFinite(VectorQ qs)
Sampler for the values of a finite sequence.
sample() returns each of the values of qs in order.QSamplerPtr
makeFinite(QSamplerPtr sampler, int cnt)
A sampler to that returns only the first cnt samples from
another sampler.
The sampler is considered empty as soon as sampler is empty or the
sampler has been called cnt times or more.QSamplerPtr
makeFixed(Q q)
Sampler that always returns the same configuration.
The sampler is considered never empty (empty() always returns false).QSamplerPtr
makeNormalized(QSamplerPtr sampler, QNormalizer normalizer)
Map a sampler of standard configurations into a sampler of
normalized configurations.QSamplerPtr
makeSingle(Q q)
Sampler that always returns a single configuration.
The sample() returns q the first time the method is called and the
empty configuration otherwise.QSamplerPtr
makeUniform(PairQ bounds)
Uniform random sampling for a box of the configuration space.QSamplerPtr
makeUniform(Device device)
Uniform random sampling for a device.QSamplerPtr
makeUniform(DeviceCPtr device)
Uniform random sampling for a device.Q
sample()
Sample a configuration.
If sampling fails, the sampler may return the empty configuration.



Constructor Detail

QSamplerPtr
public QSamplerPtr(long cPtr, boolean cMemoryOwn)

QSamplerPtr
public QSamplerPtr()
Default constructor yielding a NULLpointer.

QSamplerPtr
public QSamplerPtr(QSampler ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.


Method Detail

getCPtr
public static long getCPtr(QSamplerPtr obj)

delete
public void delete()

deref
public QSampler deref()
The pointer stored in the object.

__ref__
public QSampler __ref__()
Dereferencing operator.

getDeref
public QSampler getDeref()
Member access operator.

equals
public boolean equals(QSampler p)

isShared
public boolean isShared()
check if this Ptr has shared ownership or none
ownership Returns:
 true if Ptr has shared ownership, false if it has no ownership.

isNull
public boolean isNull()
checks if the pointer is null Returns:
 Returns true if the pointer is null

cptr
public QSamplerCPtr cptr()

sample
public Q sample()
Sample a configuration.
If sampling fails, the sampler may return the empty configuration. If
empty() is true then the sampler has no more configurations.
Otherwise sample() may (or may not) succeed if called a second time.

empty
public boolean empty()
True if the sampler is known to contain no more
configurations.

makeEmpty
public QSamplerPtr makeEmpty()
Empty sampler.

makeFixed
public QSamplerPtr makeFixed(Q q)
Sampler that always returns the same configuration.
The sampler is considered never empty (empty() always returns false).

makeSingle
public QSamplerPtr makeSingle(Q q)
Sampler that always returns a single configuration.
The sample() returns q the first time the method is called and the
empty configuration otherwise. empty() returns true after the first
call of sample().

makeFinite
public QSamplerPtr makeFinite(VectorQ qs)
Sampler for the values of a finite sequence.
sample() returns each of the values of qs in order. When all of
these samples have been returned, empty() returns true and sample()
returns the empty configuration.

makeFinite
public QSamplerPtr makeFinite(QSamplerPtr sampler, int cnt)
A sampler to that returns only the first cnt samples from
another sampler.
The sampler is considered empty as soon as sampler is empty or the
sampler has been called cnt times or more.

makeUniform
public QSamplerPtr makeUniform(PairQ bounds)
Uniform random sampling for a box of the configuration space.

makeUniform
public QSamplerPtr makeUniform(Device device)
Uniform random sampling for a device.

makeUniform
public QSamplerPtr makeUniform(DeviceCPtr device)
Uniform random sampling for a device.

makeNormalized
public QSamplerPtr makeNormalized(QSamplerPtr sampler, QNormalizer normalizer)
Map a sampler of standard configurations into a sampler of
normalized configurations.

make
public QSamplerPtr make(QIKSamplerPtr sampler, Transform3D target)
A sampler of IK solutions for a specific target.
 Parameters:
sampler
 [in] Sampler of IK solutions for target.target
 [in] Target for IK solver.

makeConstrained
public QSamplerPtr makeConstrained(QSamplerPtr sampler, QConstraintCPtr constraint, int maxAttempts)
A sampler filtered by a constraint.
For each call of sample() up to maxAttempts configurations are
extracted from sampler and checked by constraint. The first
sample that satisfies the constraint is returned; if no such were
found the empty configuration is returned.
If maxAttempts is negative (this is the default), then sampler
is sampled forever until either the sampler is empty or a
configuration satisfying constraint is found.

makeConstrained
public QSamplerPtr makeConstrained(QSamplerPtr sampler, QConstraintCPtr constraint)
A sampler filtered by a constraint.
For each call of sample() up to maxAttempts configurations are
extracted from sampler and checked by constraint. The first
sample that satisfies the constraint is returned; if no such were
found the empty configuration is returned.
If maxAttempts is negative (this is the default), then sampler
is sampled forever until either the sampler is empty or a
configuration satisfying constraint is found.

makeBoxDirectionSampler
public QSamplerPtr makeBoxDirectionSampler(PairQ bounds)
Sampler of direction vectors for a box shaped configuration
space.
Each random direction vector is found by sampling a configuration
uniformly at random from bounds, and returning the vector from the
center of the box to the configuration. The returned direction vector
can therefore be of length zero.

