Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Alex

Pages: [1]
1
ActiveX / Is it possible to unselect a state ?
« on: July 29, 2014, 16:03:15  »
Hi,

I have entered evidence for a discrete chance node with the simple function SelectState() and then propagated it through the network with the function Propagate(). I wondered if it there is a function that would unselect the state ?

Thanks.

2
ActiveX / How to manipulate posterior marginals ?
« on: July 14, 2014, 11:29:04  »
Hello,

I would like to manipulate posterior marginals of discrete chance nodes, e.g. node.Belief(x). But the access of this method is only for reading purpose whereas I would need one to be for writing also. Is there a way of doing so or to circumvent it ?

Thank you in advance

3
ActiveX / Using invoke function in Matlab
« on: July 08, 2014, 17:39:18  »
Hi,

I am using the invoke function in Matlab to handle the objects and their methods in Matlab. For example I have the following code to create a discrete labeled node:

function [ node ] = invokeDiscreteNodeLabeled(LabelCollection,domain,nodename)
%   LabelCollection is a Matlab cell containing the labels for the states
%   of the node
%   domain is the domain of the BN we consider
%   nodename is the name of the node

nstates=length(LabelCollection);
node=invoke(domain,'GetNewNode','hCategoryChance','hKindDiscrete');
set(node,'Name',nodename);
set(node,'Label',nodename);
set(node,'SubType','hSubtypeLabel');
set(node,'NumberOfStates',nstates);
for i=1:nstates
    set(node,'StateLabel',i-1,LabelCollection{i});
end

end

The above code works perfectly but when I try to do the same to create a boolean node I get the following error

Error using Interface.HUGIN_API_ActiveX_Server_7.3.Node/set
Invoke Error, Dispatch Exception:
Source: HAPI
Description: An API function was called with an invalid argument (e.g., a NULL object was passed to a
function that expects a non-NULL argument).

Error in invokeDiscreteBooleanNode (line 7)
set(node,'SubType','hSubtypeBoolean');

The code for the boolean node is the following:

function [ node ] = invokeDiscreteBooleanNode(domain,nodename)
%invokeDiscreteBooleanNode Create a boolean node

node=invoke(domain,'GetNewNode','hCategoryChance','hKindDiscrete');
set(node,'Name',nodename);
set(node,'Label',nodename);
set(node,'SubType','hSubtypeBoolean');

end

Thank you in advance for your answer !

Pages: [1]