Overview
Comment:Now uses varname.m to generate variable names
-- thus name format is determined by varname.m only.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 155c665a01051121e305ab974b362b987d6ed231fd7096e2baf149969287492f
User & Date: gawthrop@users.sourceforge.net on 2003-03-24 09:00:15
Other Links: branch diff | manifest | tags
Context
2003-03-24
09:09:52
Reformated to octave standard
Now writes variables in non-matrix form
check-in: 28603d680f user: gawthrop@users.sourceforge.net tags: origin/master, trunk
09:00:15
Now uses varname.m to generate variable names
-- thus name format is determined by varname.m only.
check-in: 155c665a01 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2003-03-14
15:23:24
Avoid problems when ginsh command contains $1 etc
Avoid error when null string returned
check-in: 84a526bf4f user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/lib/comp/simple/junction_seqn.m from [53138c6ea2] to [3462a7ac23].

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
  endif

  ## Is output same causality as junction?
  same_type = outsig(2)==i_jun_type;


  ## LHS 
  eqn = sprintf("%s(%i,%i) :=", Name, abs(outsig(1)), cause2index(outsig(2)));

  ## Find the input bond of the same causality as junction
  one = ones(N,1);
  inport = find(insigs(:,2)==i_jun_type*one);

  ##RHS
  if same_type
    insig = insigs(inport,:);
    inname = innames(inport,:);
    eqn = sprintf("%s\n\t%s(%i,%i)", eqn, Name, abs(insigs(inport,1)),cause2index(i_jun_type));
  else
    insig=[];
    inname="";
    inports = [];
    out_dir = sign(insigs(inport,1));
    for i=1:N
      if i!=inport
	in_dir = sign(insigs(i,1));
	plusminus = sign2name(-in_dir*out_dir);
	eqn = sprintf("%s\n\t%s%s(%i,%i)", eqn, plusminus, Name, \
		      abs(insigs(i,1)), cause2index(-i_jun_type));
	insig = [insig; insigs(i,:)];
	inname = [inname; innames(i,:)];
      endif
    endfor
  endif
  eqn = sprintf("%s;", eqn);
  insigs = insig;







|









|









|
|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
  endif

  ## Is output same causality as junction?
  same_type = outsig(2)==i_jun_type;


  ## LHS 
  eqn = sprintf("%s :=", varname(Name, abs(outsig(1)), outsig(2)));

  ## Find the input bond of the same causality as junction
  one = ones(N,1);
  inport = find(insigs(:,2)==i_jun_type*one);

  ##RHS
  if same_type
    insig = insigs(inport,:);
    inname = innames(inport,:);
    eqn = sprintf("%s\n\t%s", eqn, varname(Name, abs(insigs(inport,1)),i_jun_type));
  else
    insig=[];
    inname="";
    inports = [];
    out_dir = sign(insigs(inport,1));
    for i=1:N
      if i!=inport
	in_dir = sign(insigs(i,1));
	plusminus = sign2name(-in_dir*out_dir);
	eqn = sprintf("%s\n\t%s%s", eqn, plusminus, varname(Name, \
		      abs(insigs(i,1)), -i_jun_type));
	insig = [insig; insigs(i,:)];
	inname = [inname; innames(i,:)];
      endif
    endfor
  endif
  eqn = sprintf("%s;", eqn);
  insigs = insig;


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]