raamboscreen(PORT)- implements a character based communication to a Raambo®-Robot via serial link (USB) |
% raamboscreen(PORT) - implements a character based communication to a Raambo®-Robot via serial link (USB) % (by Tim Lueth, VLFL-Lib, 2024-MÄR-02 as class: SERIAL-ROBOTICS) % % does not complety work like screen, but the most possible terminal in % Matlab (Status of: 2024-03-03) % % Introduced first in SolidGeometry 5.4 % % See also: serialport, raambocommandlines, readkeyboardchar % % raamboscreen(PORT) % === INPUT PARAMETERS === % PORT: already opened PORT such as COM1 or /dev/tty.usb11001 % % EXAMPLE: %% Unplug and plugin cable to the robot on robot side first % COM1=serialport('/dev/tty.usbmodem21201',230400); % raamboscreen(COM1); % % See also: serialport, raambocommandlines, readkeyboardchar % % % Copyright 2024 Tim C. Lueth |
raambocommandlines(PORT)- implements a command line based communication to a Raambo®-Robot via serial link (USB) |
% raambocommandlines(PORT) - implements a command line based communication to a Raambo®-Robot via serial link (USB) % (by Tim Lueth, VLFL-Lib, 2024-MÄR-02 as class: SERIAL-ROBOTICS) % % fnctn % 1st reads out text from the serial link and prints it using printf % 2nd reads in a text line using matlabs input( % 3rd sends it to the robot via serial link % 4th reads out text from the serial link and prints it using printf % (Status of: 2024-03-03) % % Introduced first in SolidGeometry 5.4 % % See also: serialport, raamboscreen % % raambocommandlines(PORT) % === INPUT PARAMETERS === % PORT: already opened PORT such as COM1 or /dev/tty.usb11001 % % EXAMPLE: %% Unplug and plugin cable to the robot on robot side first % COM1=serialport('/dev/tty.usbmodem21201',230400); % raambocommandlines(COM1); % % % See also: serialport, raamboscreen % % % Copyright 2024 Tim C. Lueth |
readkeyboardchar(cmdarray)- reads a single keyboard key or returns empty |
% readkeyboardchar(cmdarray) - reads a single keyboard key or returns empty % (by Tim Lueth, VLFL-Lib, 2024-MÄR-02 as class: USER INTERFACE) % % THIS fnctn readkeyboardchar is used for the serial robotics terminal % communication. % In contrast to getkeyboardchar, this fnctn does not wait. % A problem is, that the key is plotted in the command window. (Status % of: 2024-03-03) % % Introduced first in SolidGeometry 5.4 % % See also: getkeyboardchar % % [cc,cmdarray]=readkeyboardchar(cmdarray) % === INPUT PARAMETERS === % cmdarray: optional keyboard buffer to extend OR false for delete % keyboard buffer % === OUTPUT RESULTS ====== % cc: last char or empty % cmdarray: keyboard including last char % % EXAMPLE: % [a,b]=readkeyboardchar(false); while ~isequal(a,char(13)); [a,b]=readkeyboardchar(b);end; b, uint8(b) % % See also: getkeyboardchar % % % Copyright 2024 Tim C. Lueth |
SGaddsurfpoints(SG,alpha,ds,dx,dy)- adds gridpoints at surfaces and edges at all surfaces |
% SGaddsurfpoints(SG,alpha,ds,dx,dy) - adds gridpoints at surfaces and edges at all surfaces % (by Tim Lueth, VLFL-Lib, 2024-FEB-18 as class: SURFACES) % % Introduced first in SolidGeometry 5.4 % % See also: SGremsurfpoints, SGalphaShape, SGremsurfedgepoints, % SGremedgepoints % % SGN=SGaddsurfpoints(SG,[alpha,ds,dx,dy]) % === INPUT PARAMETERS === % SG: Solid geometry % alpha: angle for surface differentiation; default is 0.01 % ds: distance on edges; default is % dx: distance in x; default is 1 % dy: distance in y; default is dx % === OUTPUT RESULTS ====== % SGN: Solid geometry with additional points on edges and surfaces % % EXAMPLE: % XXX=SGaddsurfpoints(SGsample(16),'',1,1,1); dbplot(XXX); % % XXX=SGaddsurfpoints(SGsample(16),'',[1 2 1]); dbplot(XXX); % % See also: SGremsurfpoints, SGalphaShape, SGremsurfedgepoints, % SGremedgepoints % % % Copyright 2024 Tim C. Lueth |
VLisonCVL(CVL,PL,tol)- returns wether a point is on a segment of a CVL or CPL |
% VLisonCVL(CVL,PL,tol) - returns wether a point is on a segment of a CVL or CPL % (by Tim Lueth, VLFL-Lib, 2024-FEB-15 as class: CLOSED POLYGON LISTS) % % MUST DISTINGUISH between open and closed lines % exists also as distanceVLtoVLEL 2018-MÄR-11 with tolerances % (Status of: 2024-02-18) % % Introduced first in SolidGeometry 5.4 % % See also: CPLinsideCPL, insideCPS, insidePLEL, distanceVLtoVLEL % % [ci,tp]=VLisonCVL([CVL,PL,tol]) % === INPUT PARAMETERS === % CVL: CPL or CVL % PL: PL or VL % tol: if tol > 0; fnctn distanceVLtoVLEL is used; default is 0; much % faster with 0 % === OUTPUT RESULTS ====== % ci: index of PL % tp: matrix of PL and segment list of CVL % % EXAMPLE: % CVL=CVLsample(17); [a,b]=VLisonCVL(CVL,CVL([1 28 38],:)), VLisonCVL(CVL,CVL([1 28 38],:)); % VLisonCVL(CVL,[4 4 4]); % CVL=CVLsample(17); VLisonCVL(CVL,CVL([1 28 39],:)+0.01,0.1); [a,b]=VLisonCVL(CVL,CVL([1 28 38],:)+0.01,0.1) % % See also: CPLinsideCPL, insideCPS, insidePLEL, distanceVLtoVLEL % % % Copyright 2024 Tim C. Lueth |
SGrescBox(s,"STL")- Creates for the iMedCap Rescue Robotics Project a 1:10 Model of the Patient Box |
% SGrescBox(s,"STL") - Creates for the iMedCap Rescue Robotics Project a 1:10 Model of the Patient Box % (by Tim Lueth, VLFL-Lib, 2024-FEB-14 as class: PARAMETRIC DESIGN) % % Uses SGcutTinsertpins to make the model printable as FDM (Status of: % 2024-02-15) % % Introduced first in SolidGeometry 5.4 % % See also: SGcutTinsertpins % % SG=SGrescBox([s,"STL"]) % === INPUT PARAMETERS === % s: [length width height ramp profile]; default is [220 70 75 70 4] or so % "STL": if used, the box is separated writen to an STL-Directory % === OUTPUT RESULTS ====== % SG: Cell list of Solids {front-red, back-green} % % EXAMPLE: % SGrescBox; dbplot(ans); % % See also: SGcutTinsertpins % % % Copyright 2024 Tim C. Lueth |
XPSrulechecker(ops)- checks XPS rules for easy human errors during rule definition |
% XPSrulechecker(ops) - checks XPS rules for easy human errors during rule definition % (by Tim Lueth, VLFL-Lib, 2024-JAN-28 as class: ARTIFICIAL INTELLIGENCE) % % under constant development (Status of: 2024-02-03) % % Introduced first in SolidGeometry 5.4 % % See also: XPSblocksworldequation, XPSlawcase, XPSblocksworld, % XPSslidingpuzzle % % XPSrulechecker(ops) % === INPUT PARAMETERS === % ops: STRIPS rules [Action, Condition-List, Add-list, Delete-list, % NOT-Condition-List] % % See also: XPSblocksworldequation, XPSlawcase, XPSblocksworld, % XPSslidingpuzzle % % % Copyright 2024 Tim C. Lueth |
XPSslidingpuzzle- Expert System implementing the first General Problem Solver (AI Programm) |
% XPSslidingpuzzle - Expert System implementing the first General Problem Solver (AI Programm) % (by Tim Lueth, VLFL-Lib, 2024-JAN-08 as class: ARTIFICIAL INTELLIGENCE) % % This creates simple the test data for the GPS=AI with respect to to % Peter Norvig (1991) similar to XPSblocksworld % Please test also uncomplete goal conditions such as "space on 4" % (Status of: 2024-01-10) % % Introduced first in SolidGeometry 5.4 % % See also: XPSGPS, XPSEQS, XPSblocksworld % % LITERATURE: % - Norvig, Peter (1991): Paradigms of Artificial Intelligence % Programming, Morgan Kaufmann Publisher, San Mateo, CA, USA % - Korf, R., and Schultze, P. 2005. Large-scale parallel breadth-first % search. In Proceedings of the 20th National Conference on Artificial % Intelligence (AAAI-05), 1380–1385. % % [ops,start,goal]=XPSslidingpuzzle % === OUTPUT RESULTS ====== % ops: cell list [n x 4] describing action-name, precondition, add-state, % diff-state % start: string array describing the start state % goal: string array describing the final state % % EXAMPLE: % [ops,start,goal]=XPSslidingpuzzle % Example efinitions of operators start-state and goal-state % XPSEQS(ops,start, goal, 'debug') % takes very very long % XPSEQS(ops,start, ["space on 6"], 'debug'); % [a,b,c,d]=XPSEQS(ops,start, ["space on 6"], 'debug','first'); % 4 seconds % tic; [a,b,c,d]=XPSEQS(ops,start, ["space on 6" "A on 4"], 'first'); toc % 90 seconds % % See also: XPSGPS, XPSEQS, XPSblocksworld % % % Copyright 2024 Tim C. Lueth |
CPLbox(sze,txt)- create a CPL of a square including text |
% CPLbox(sze,txt) - create a CPL of a square including text % (by Tim Lueth, VLFL-Lib, 2023-DEZ-23 as class: CLOSED POLYGON LISTS) % % Useful for the box world domain. Slow fnctn because of CPLoftext % (Status of: 2023-12-29) % % Introduced first in SolidGeometry 5.4 % % See also: PLsquare, CPLoftext, CPLfitsinCPL % % CPL=CPLbox([sze,txt]) % === INPUT PARAMETERS === % sze: [x y]; default is 10 % txt: chars for labeling % === OUTPUT RESULTS ====== % CPL: CPL of Contour % % EXAMPLE: % CPL=CPLbox(10,'A'); SGfigure(0,90); CPSplot(CPL); % CPLbox([30 20],'test') % CPLbox([300 20],'Table'); % % % See also: PLsquare, CPLoftext, CPLfitsinCPL % % % Copyright 2023 Tim C. Lueth |
exp_2023_12_21block- EXPERIMENT TO CREATE AND DETECT SITUATONS IN BLOCK WORLD PROBLEMS |
% exp_2023_12_21block - EXPERIMENT TO CREATE AND DETECT SITUATONS IN BLOCK WORLD PROBLEMS % (by Tim Lueth, VLFL-Lib, 2023-DEZ-21 as class: EXPERIMENTS) % % Introduced first in SolidGeometry 5.4 % % exp_2023_12_21block % % % Copyright 2023 Tim C. Lueth |
CPLobjects2cells(CPL)- returns CPL as cell list of CPLs separated by not-overlapping outer-border CPLs |
% CPLobjects2cells(CPL) - returns CPL as cell list of CPLs separated by not-overlapping outer-border CPLs % (by Tim Lueth, VLFL-Lib, 2023-DEZ-20 as class: CLOSED POLYGON LISTS) % % reverse fnctn is: CPLcell2NaN % (Status of: 2023-12-20) % % Introduced first in SolidGeometry 5.4 % % See also: CPLsortinout, CPLregions, PSregions, CPLcellobjects, % CPLcell2NaN, CPLregions2cell % % CPLN=CPLobjects2cells(CPL) % === INPUT PARAMETERS === % CPL: NaN separated CPL % === OUTPUT RESULTS ====== % CPLN: cell list of CPLs separated by not-overlapping outer-border CPLs % % EXAMPLE: CPLbox('','A'); A=ans; CPLbox('','B'); B=ans; CPLbox('','C'); C=ans; CPLbox('','D'); D=ans; % CPLbox([70 5],'table'); T=ans; % CPLarrange({A,B,C,D},T,'ontop',1,'add'); CPL=ans; SGfigure; CPSplot(CPL); % CPLobjects2cells(CPL), CPLN=ans; % % See also: CPLsortinout, CPLregions, PSregions, CPLcellobjects, % CPLcell2NaN, CPLregions2cell % % % Copyright 2023 Tim C. Lueth |
CPLselectspatial(CPL,rel,"object")- selects parts of CPL based on spatial or other relations |
% CPLselectspatial(CPL,rel,"object") - selects parts of CPL based on spatial or other relations % (by Tim Lueth, VLFL-Lib, 2023-DEZ-20 as class: ARTIFICIAL INTELLIGENCE) % % Very powerful and comprehension-enhancing fnctn. This fnctn is under % continous development (Status of: 2023-12-20) % % Introduced first in SolidGeometry 5.4 % % See also: selectNaN, CPLselectbynearestP, CPLselectbyP % % CPLA=CPLselectspatial(CPL,[rel,"object"]) % === INPUT PARAMETERS === % CPL: Closed Polygon List % rel: spatial or other relation % "object": if used objects instead of CPLs are used in general % === OUTPUT RESULTS ====== % CPLA: Selected CPL % % EXAMPLE: % CPLbox('','A'); A=ans; CPLbox('','B'); B=ans; CPLbox('','C'); C=ans; CPLbox('','D'); D=ans; % CPLbox([10 3],'space'); S=ans; CPLbox([70 5],'table'); T=ans; % CPLarrange({A,B,C,S},T,'ontop',1,'add'); CPL=ans; SGfigure; CPSplot(CPL); % CPLselectspatial(CPL,'top','left',2) % CPLselectspatial(CPL,'object','top','left',2) % CPLselectspatial(CPL,'equalobj',C) % CPLselectspatial(CPL,'object','overobj',T,'equalobj',A); % Gibt es ein Object A oberhalb von Table % CPLselectspatial(CPL,'object','overobj',T,'left',2); % CPLselectspatial(CPL,'overobj',T,'left',2); % CPLselectspatial(CPL,'overobj',T,'left',2:200,'top',1); % CPLselectspatial(CPL,'object','overobj',T,'equalobj',A); XXX=ans; CPLN=CPLsubtract(CPL,XXX); SGfigure; CPSplot(CPLN) % YYY=CPLtransrelCPL(A,CPLselectspatial(CPL,'object','equalobj',B),'center','ontop',1); CPLunion(CPLN,YYY); CPLM=ans; % SG=SGofCPLextrude(CPLM,10,'y'); SGfigure(SG); % % See also: selectNaN, CPLselectbynearestP, CPLselectbyP % % % Copyright 2023 Tim C. Lueth |
CPLregions2cell(ps)- returns CPL as cell list of CPLs separated by not-overlapping outer-border CPLs |
% CPLregions2cell(ps) - returns CPL as cell list of CPLs separated by not-overlapping outer-border CPLs % (by Tim Lueth, VLFL-Lib, 2023-DEZ-20 as class: CLOSED POLYGON LISTS) % % reverse fnctn is: CPLcell2NaN % (Status of: 2023-12-29) % % Introduced first in SolidGeometry 5.4 % % See also: CPLsortinout, CPLregions, PSregions, CPLcellobjects, % CPLcell2NaN % % CPL=CPLregions2cell(ps) % === INPUT PARAMETERS === % ps: NaN separated CPL % === OUTPUT RESULTS ====== % CPL: cell list of CPLs separated by not-overlapping outer-border CPLs % % EXAMPLE: CPLbox('','A'); A=ans; CPLbox('','B'); B=ans; CPLbox('','C'); C=ans; CPLbox('','D'); D=ans; % CPLbox([70 5],'table'); T=ans; % CPLarrange({A,B,C,D},T,'ontop',1,'add'); CPL=ans; SGfigure; CPSplot(CPL); % CPLregions2cell(CPL), CPLN=ans; % % See also: CPLsortinout, CPLregions, PSregions, CPLcellobjects, % CPLcell2NaN % % % Copyright 2023 Tim C. Lueth |
CPLisidenticalregistered(CPLA,CPLB,tol)- Compares two CPLS in the same orientation and size |
% CPLisidenticalregistered(CPLA,CPLB,tol) - Compares two CPLS in the same orientation and size % (by Tim Lueth, VLFL-Lib, 2023-DEZ-20 as class: CLOSED POLYGON LISTS) % % Introduced first in SolidGeometry 5.4 % % See also: TregisterConvexHull, CPLisidenticalcontour % % [b,A]=CPLisidenticalregistered(CPLA,CPLB,[tol]) % === INPUT PARAMETERS === % CPLA: 1st CPL % CPLB: 2nd CPL % tol: tolerance in relative difference area; default is 0.1 % === OUTPUT RESULTS ====== % b: logical information % A: difference in area % % EXAMPLE: % CPL=CPLbox(10,'A'); % CPLisidenticalregistered(CPL,PLtransP(CPL,[10 10])) % CPLisidenticalregistered(CPL,PLtransP(CPLbox(10),[10 10])) % % % See also: TregisterConvexHull, CPLisidenticalcontour % % % Copyright 2023 Tim C. Lueth |
CPLcell2NaN(CPL)- concatenates a cell list of CPLs into one single CPL |
% CPLcell2NaN(CPL) - concatenates a cell list of CPLs into one single CPL % (by Tim Lueth, VLFL-Lib, 2023-DEZ-20 as class: CLOSED POLYGON LISTS) % % the opposite fnctns are: % CPLobjects2cells % CPLregions2cell (Status of: 2023-12-29) % % Introduced first in SolidGeometry 5.4 % % See also: CPLobjects2cells, CPLregions2cell, CPLbox % % CPLN=CPLcell2NaN(CPL) % === INPUT PARAMETERS === % CPL: Cell list of CPLs % === OUTPUT RESULTS ====== % CPLN: CPL that is a simple concatenation of all contours in CPL % % EXAMPLE: % if ~exist('A') || ~exist('B') || ~exist('C') || ~exist('D') || ~exist('S') || ~exist('T') % CPLbox('','A'); A=ans; CPLbox('','B'); B=anCPLs; CPLbox('','C'); C=ans; CPLbox('','D'); D=ans; % CPLbox([10 5],'space'); S=ans; CPLbox([70 5],'table'); T=ans; % end % CPLarrange({A,B,C,S},T,'ontop',1,'add'); CPL=ans; SGfigure; CPSplot(CPL); % CPLC=CPLobjects2cells(CPL) % CPLcell2NaN(CPLC) % % % See also: CPLobjects2cells, CPLregions2cell, CPLbox % % % Copyright 2023 Tim C. Lueth |
CPLarrange(CPLC,CPL2)- Arranges a set of CPLS to be as widw as another one in x dimension |
% CPLarrange(CPLC,CPL2) - Arranges a set of CPLS to be as widw as another one in x dimension % (by Tim Lueth, VLFL-Lib, 2023-DEZ-20 as class: CLOSED POLYGON LISTS) % % will be extended in future (Status of: 2023-12-29) % % Introduced first in SolidGeometry 5.4 % % See also: CPLcopypattern, CPLcopyradial % % CPLC=CPLarrange(CPLC,[CPL2]) % === INPUT PARAMETERS === % CPLC: is a cell list of CPLs % CPL2: is the dimension defining contour % === OUTPUT RESULTS ====== % CPLC: Is an NAN separated CPL % % EXAMPLE: % CPLarrange({PLcircle(4,4), PLcircle(4,3), PLcircle(4)}, PLsquare([40 5])) % % See also: CPLcopypattern, CPLcopyradial % % % Copyright 2023 Tim C. Lueth |
wordfind(txt,word,sep)- finds words in a string (charchain) |
% wordfind(txt,word,sep) - finds words in a string (charchain) % (by Tim Lueth, VLFL-Lib, 2023-DEZ-18 as class: ARTIFICIAL INTELLIGENCE) % % Introduced first in SolidGeometry 5.4 % % See also: strfind, ismember, split, join % % [pp,ccc]=wordfind(txt,word,[sep]) % === INPUT PARAMETERS === % txt: charchain to search in % word: word to look for % sep: separators; default is {',',' ',';'} % === OUTPUT RESULTS ====== % pp: array of hits % ccc: separated words % % EXAMPLE: % wordfind ('Introduced first in SolidGeometry 5.4', 'intro') % Not found % wordfind ('Introduced first in SolidGeometry 5.4', 'in') % 3rd word % wordfind ('Introduced first in SolidGeometry 5.4 in text', 'in') % two words % % See also: strfind, ismember, split, join % % % Copyright 2023 Tim C. Lueth |
XPSruleswrite(ops,fname)- writes rules into an excel sheet |
% XPSruleswrite(ops,fname) - writes rules into an excel sheet % (by Tim Lueth, VLFL-Lib, 2023-DEZ-14 as class: ARTIFICIAL INTELLIGENCE) % % The format of the rules will may change over Time (Status of: % 2023-12-14) % % Introduced first in SolidGeometry 5.4 % % See also: XPSrulesread % % rname=XPSruleswrite(ops,[fname]) % === INPUT PARAMETERS === % ops: operators % fname: filename % === OUTPUT RESULTS ====== % rname: rules full file name % % EXAMPLE: % [ops,start, goal]=XPSblocksworld; XPSruleswrite(ops,'TEST.XLS') % % See also: XPSrulesread % % % Copyright 2023 Tim C. Lueth |
XPSrulesread(fname)- reades rules from an excel sheet |
% XPSrulesread(fname) - reades rules from an excel sheet % (by Tim Lueth, VLFL-Lib, 2023-DEZ-14 as class: ARTIFICIAL INTELLIGENCE) % % The format of the rules will may change over Time (Status of: % 2023-12-20) % % Introduced first in SolidGeometry 5.4 % % See also: XPSruleswrite % % T=XPSrulesread([fname]) % === INPUT PARAMETERS === % fname: filename to read from % === OUTPUT RESULTS ====== % T: rules list % % EXAMPLE: % [ops,start, goal]=XPSblocksworld; XPSruleswrite(ops,'TEST.XLS') % XPSrulesread(rname); ops=ans % % See also: XPSruleswrite % % % Copyright 2023 Tim C. Lueth |
char2strarr(chr,splt)- converts a list of string inside a char chain into a string array |
% char2strarr(chr,splt) - converts a list of string inside a char chain into a string array % (by Tim Lueth, VLFL-Lib, 2023-DEZ-13 as class: ARTIFICIAL INTELLIGENCE) % % RESULT IS LIKE: ["space on a" "a on table" "space on b" "b on table"] % (Status of: 2023-12-13) % % Introduced first in SolidGeometry 5.4 % % See also: strarr2char % % strarr=char2strarr(chr,[splt]) % === INPUT PARAMETERS === % chr: char chain with quation mark separated strings % splt: splitchar default is '"' % === OUTPUT RESULTS ====== % strarr: string array % % EXAMPLE: % x= '"START" "move a from b to table" "move b from c to a" "move c from table to b" "FINISH"' % y=char2strarr(x) % u=strarr2char(y) % x='space on $A, space on $B, $A on $B' % char2strarr(x,',') % % See also: strarr2char % % % Copyright 2023 Tim C. Lueth |
strarr2char(strarr)- convertes a single row or single col string array into a char chain - no matrix |
% strarr2char(strarr) - convertes a single row or single col string array into a char chain - no matrix % (by Tim Lueth, VLFL-Lib, 2023-DEZ-13 as class: ARTIFICIAL INTELLIGENCE) % % RESULT IS LIKE: '"space on a" "a on table" "space on b" "b on table"' % (Status of: 2023-12-13) % % Introduced first in SolidGeometry 5.4 % % See also: char2strarr % % chr=strarr2char(strarr) % === INPUT PARAMETERS === % strarr: string array % === OUTPUT RESULTS ====== % chr: char chain that containts a string array % % EXAMPLE: % x=[ "START" "move a from b to table" "move b from c to a" "move c from table to b" "FINISH"] % y=strarr2char(x) % u=char2strarr(y) % % % See also: char2strarr % % % Copyright 2023 Tim C. Lueth |
charcell2stringcellarray(chrc)- converts xps cell list of string arrays into cell list of charchains |
% charcell2stringcellarray(chrc) - converts xps cell list of string arrays into cell list of charchains % (by Tim Lueth, VLFL-Lib, 2023-DEZ-11 as class: ARTIFICIAL INTELLIGENCE) % % RESULT IS LIKE: {["space on a" "space on c" "a on b" ]} % % the current XPS format is a cell lits of string arrays that cannot be % written in a n excel file without problems. Thid fnctn converts the % cell list of string arrays into a cell list of charchains (Status of: % 2023-12-13) % % Introduced first in SolidGeometry 5.4 % % See also: SGwritetable, array2tableTL, stringcellarray2charcell % % strac=charcell2stringcellarray(chrc) % === INPUT PARAMETERS === % chrc: cell array of char chains with quotation marks % === OUTPUT RESULTS ====== % strac: cell array of string arrays % % EXAMPLE: % [ops,start, goal]=XPSblocksworld % stringcellarray2charcell(ops); xlscell=ans % SGwritetable('test.xls',array2tableTL(xlscell,'ACTION','CONDITION','ADD_LIST','DEL_LIST')) % [T,N,c]=SGreadtable('test.xls'), charcell2stringcellarray(T) % T=readtable('test.xls'), X=table2cell(T); charcell2stringcellarray(X) % % % See also: SGwritetable, array2tableTL, stringcellarray2charcell % % % Copyright 2023 Tim C. Lueth |
stringcellarray2charcell(ops)- converts xps cell list of string arrays into cell list of charchains |
% stringcellarray2charcell(ops) - converts xps cell list of string arrays into cell list of charchains % (by Tim Lueth, VLFL-Lib, 2023-DEZ-11 as class: ARTIFICIAL INTELLIGENCE) % % RESULT IS LIKE: {'"space on a" "space on c" "a on b"' } % % the current XPS format is a cell lits of string arrays that cannot be % written in a n excel file without problems. Thid fnctn converts the % cell list of string arrays into a cell list of charchains (Status of: % 2023-12-12) % % Introduced first in SolidGeometry 5.4 % % See also: SGwritetable, array2tableTL, charcell2stringcellarray % % zzz=stringcellarray2charcell(ops) % === INPUT PARAMETERS === % ops: % === OUTPUT RESULTS ====== % zzz: % % EXAMPLE: % [ops,start, goal]=XPSblocksworld % stringcellarray2charcell(ops); xlscell=ans % SGwritetable('test.xls',array2tableTL(xlscell,'ACTION','CONDITION','ADD_LIST','DEL_LIST')) % % See also: SGwritetable, array2tableTL, charcell2stringcellarray % % % Copyright 2023 Tim C. Lueth |
xpstrings2cells(sss)- converts a char chain with quation mark separated sentences into a cell list of character chains |
% xpstrings2cells(sss) - converts a char chain with quation mark separated sentences into a cell list of character chains % (by Tim Lueth, VLFL-Lib, 2023-DEZ-11 as class: ARTIFICIAL INTELLIGENCE) % % RESULT IS LIKE: {'space on a'} {'a on table'} {'space on b'} % % This fnctn may accelerate the XPSEQS concept at a later stage. % fnctns such as contains work on charchain level % contains(xpstrings2cells(zzz),unsortrows(xpstrings2cells('"c on % table"'))') % fnctns such as ismember work on cell level (Status of: 2023-12-12) % % Introduced first in SolidGeometry 5.4 % % See also: xpstrings2cells, XPcells2strings % % ccc=xpstrings2cells(sss) % === INPUT PARAMETERS === % sss: sentences separate by quotation marks such as '"a on b" "b on c"' % === OUTPUT RESULTS ====== % ccc: cell list of sentences such as [{'space on a'} {'a on table'}] % % EXAMPLE: % sss='"space on a" "a on table" "space on b"' % xpstrings2cells(sss); ccc=ans % % % See also: xpstrings2cells, XPcells2strings % % % Copyright 2023 Tim C. Lueth |
xpcells2strings(ccc)- converts cell list of character chains into one charchain of quotation marks separated sentences |
% xpcells2strings(ccc) - converts cell list of character chains into one charchain of quotation marks separated sentences % (by Tim Lueth, VLFL-Lib, 2023-DEZ-11 as class: ARTIFICIAL INTELLIGENCE) % % RESULT IS LIKE: '"space on a" "a on table" "space on b" "b on table"' % % This fnctn may accelerate the XPSEQS concept at a later stage. % fnctns such as contains work on charchain level % contains(xpstrings2cells(zzz),unsortrows(xpstrings2cells('"c on % table"'))') % fnctns such as ismember work on cell level (Status of: 2023-12-12) % % Introduced first in SolidGeometry 5.4 % % See also: xpstrings2cells % % sss=xpcells2strings(ccc) % === INPUT PARAMETERS === % ccc: cell list of sentences such as [{'space on a'} {'a on table'}] % === OUTPUT RESULTS ====== % sss: sentences separate by quotation marks % % EXAMPLE: % ccc=[{'space on a'} {'a on table'} {'space on b'}] % sss='"space on a" "a on table" "space on b" "b on table" "space on c" "c on table"' % xpcells2strings(ccc); sss=ans; % % % See also: xpstrings2cells % % % Copyright 2023 Tim C. Lueth |
stringpatternpermute(equat,symb,samp)- creates symbol permutation for string pattern equations |
% stringpatternpermute(equat,symb,samp) - creates symbol permutation for string pattern equations % (by Tim Lueth, VLFL-Lib, 2023-DEZ-07 as class: ARTIFICIAL INTELLIGENCE) % % Flight back from Hefei to Munich (Status of: 2023-12-08) % % Introduced first in SolidGeometry 5.4 % % See also: cell2strarr, strarr2cell % % [VV,LL,CC]=stringpatternpermute(equat,symb,samp) % === INPUT PARAMETERS === % equat: string array of equation % symb: string array of symbol names % samp: cell list of samples for each symbol % === OUTPUT RESULTS ====== % VV: permutation of the string pattern equations % LL: permutation of unique symbols % CC: index of LL that has been used for VV % % EXAMPLE: % stringpatternpermute("$A on $B",["$A" "$B"],{["TIM" "BOOK"]; ["SHELF" "BED"]}) % stringpatternpermute(["$A on $B" "$A buys $B"],["$A" "$B"],{["TIM" "BOOK"]; ["SHELF" "BED"]}) % stringpatternpermute(["$A on $B" "$A buys $B"],["$A" "$B"],{["TIM" "BOOK"]; ["SHELF" "BED"]}); cell2strarr(ans) % stringpatternpermute(["$A on $B" "$A buys $B"],["$A" "$B"],{["TIM" "BOOK"]; ["SHELF" "BED" "TIM"]}) % [a,b,c]=stringpatternpermute(["$A on $B" "$A buys $B"],["$A" "$B"],{["TIM" "BOOK"]; ["TIM" "SHELF" "BED" "TIM"]}) % % See also: cell2strarr, strarr2cell % % % Copyright 2023 Tim C. Lueth |
strarr2cell(strarr,rememt)- converts a string array into a cell list of string |
% strarr2cell(strarr,rememt) - converts a string array into a cell list of string % (by Tim Lueth, VLFL-Lib, 2023-DEZ-07 as class: ARTIFICIAL INTELLIGENCE) % % Flight back from Hefei to Munich (Status of: 2023-12-07) % % Introduced first in SolidGeometry 5.4 % % See also: cell2strarr, stringpatternpermute % % ccc=strarr2cell(strarr,[rememt]) % === INPUT PARAMETERS === % strarr: stringarray % rememt: if true, empty entries are removed % === OUTPUT RESULTS ====== % ccc: cell list with string entries % % EXAMPLE: % clc; yyy={["c" "table" "space" "b" "a"];["ontop" "under" "between" ]} % cell2strarr(yyy); xxx=ans, strarr2cell(xxx) % cell2strarr(yyy); xxx=ans, strarr2cell(xxx,true) % no empty entries % cell2strarr(yyy); xxx=ans, strarr2cell(xxx,true); zzz=ans, permutevarargin(zzz{:}) % no empty entries % % See also: cell2strarr, stringpatternpermute % % % Copyright 2023 Tim C. Lueth |
cell2strarr(ccc,joinch)- converts string arrays in cell lines into a string array |
% cell2strarr(ccc,joinch) - converts string arrays in cell lines into a string array % (by Tim Lueth, VLFL-Lib, 2023-DEZ-07 as class: ARTIFICIAL INTELLIGENCE) % % Flight back from Hefei to Munich (Status of: 2023-12-07) % % Introduced first in SolidGeometry 5.4 % % See also: strarr2cell, stringpatternpermute % % stra=cell2strarr(ccc,[joinch]) % === INPUT PARAMETERS === % ccc: cell list of string lines % joinch: if a joint char is used the string array has only one column % === OUTPUT RESULTS ====== % stra: stringarray % % EXAMPLE: % yyy={["c" "table" "space" "b" "a"];["c" "table" "space" ]} % cell2strarr(yyy) % 2 x 5 array % cell2strarr(yyy," ") % 2 x 1 array % % % See also: strarr2cell, stringpatternpermute % % % Copyright 2023 Tim C. Lueth |
varsofstringpattern(cond)- finds all the symbolvariables in a string array |
% varsofstringpattern(cond) - finds all the symbolvariables in a string array % (by Tim Lueth, VLFL-Lib, 2023-DEZ-03 as class: ARTIFICIAL INTELLIGENCE) % % waiting for the flight to Bejing CA962. (Status of: 2023-12-08) % % Introduced first in SolidGeometry 5.4 % % See also: stringpatterncondition, XPSEQS % % [var,patt]=varsofstringpattern(cond) % === INPUT PARAMETERS === % cond: string array with terms that use $XXX as variable name % === OUTPUT RESULTS ====== % var: string array with variable Name including %char % patt: % % EXAMPLE: % varsofstringpattern(["space on $A", "space on $C", "$A on $B"]) % % See also: stringpatterncondition, XPSEQS % % % Copyright 2023 Tim C. Lueth |
XPSconditionfindneval(cond,state,VLIST)- creates all combinations of a variable based CONDITION that could fit a fact list CONDITION |
% XPSconditionfindneval(cond,state,VLIST) - creates all combinations of a variable based CONDITION that could fit a fact list CONDITION % (by Tim Lueth, VLFL-Lib, 2023-NOV-30 as class: ARTIFICIAL INTELLIGENCE) % % 1st name was "stringpatterncondition" % This fnctn checks whether a list of conditions (COND is a fact string % array with variables $) can occur or is applicable in a given state % (STATE is a fact string array without variables). If the list COND is % applicable in STATE with several different variable assignments, all % applicable combinations of the variables are delivered and further % variable-based lists can be instantiated with the instantiated % variables. % % XPpermute(' ',["a" "b"],["C" "D"]) % Equations, or systems of equations, that are based on the form "$A on % $B" must be limited in their scope of application in some way so that % the recursion or planning comes to an end. For example, NOT (table on % ANY)For example, by specifying the set of allowed or disallowed symbols % % This fnctns as part of the general Problem solver can also be used as % logical reasoning % cond = condition % state = state % VLIST = everything that also is valid under this condition (Status of: % 2024-01-26) % % Introduced first in SolidGeometry 5.4 % % See also: stringpatterncompare, stringpatternreplace, XPSEQS % % LITERATURE: % - Norvig, Peter (1991): Paradigms of Artificial Intelligence % Programming, Morgan Kaufmann Publisher, San Mateo, CA, USA % % [RLIST,VLIST,VARS,INST,SYMS]=XPSconditionfindneval(cond,state,[VLIST]) % === INPUT PARAMETERS === % cond: string array of conditions with Variables of Type $Str % state: string array of facts % VLIST: Additional string arrys with variables % === OUTPUT RESULTS ====== % RLIST: all possible condition strings that are part of state % VLIST: all possible additional condition strings that use the same % combination of VARS/INST % VARS: all used symbol names in cond % INST: all symbol combinations used as variables that fullfill the % condition in state % SYMS: string array of all samples % % EXAMPLE: % [~,start,goal]=XPSblocksworld; % clc;XPSconditionfindneval(["space on $A", "space on $C", "$A on $B"],start) % clc;XPSconditionfindneval([ "space on $A", "space on $C", "$A on $B"],start,["move $A from $B to $C"], ["$A on $C", "space on $B"], ["$A on $B", "space on $C"]) % clc;XPSconditionfindneval(["$A on $B"],["space on a", "a on b", "b on c", "c on table", "space on table"]) % 5 Solutions for "$A on $B" % clc;XPSconditionfindneval(["space on $A" "$A on $B"],["space on a", "a on b", "b on c", "c on table", "space on table"]) % 1 Solutions for "$A on $B" % clc;XPSconditionfindneval(["space on $A" "$B on $A"],["space on a", "a on b", "b on c", "c on table", "space on table"]) % 1 Solutions for "$B on $A" % clc;XPSconditionfindneval(["$A on $B"],["space on a", "a on b", "b on c", "c on table", "space on table"],["$A loves $B"]) % 5 Solutions that create lists % % See also: stringpatterncompare, stringpatternreplace, XPSEQS % % % Copyright 2023-2024 Tim C. Lueth |
stringpatterncompare(pattern,txt)- compares strings including variable strings |
% stringpatterncompare(pattern,txt) - compares strings including variable strings % (by Tim Lueth, VLFL-Lib, 2023-NOV-30 as class: ARTIFICIAL INTELLIGENCE) % % Introduced first in SolidGeometry 5.4 % % See also: stringpatternreplace, XPSGPS, XPSGPSEQ, stringpatterncondition % % PAR=stringpatterncompare(pattern,txt) % === INPUT PARAMETERS === % pattern: pattern such as "move $A from $B to $C" % txt: text to analyze such as "move A from B to C" % === OUTPUT RESULTS ====== % PAR: List of parameters % % EXAMPLE: % stringpatterncompare("move A from B to C", "move A from B to C") % identical % stringpatterncompare("move A from B to C", "move X from Y to C") % different % stringpatterncompare("move $A from $B to C", "move X from Y to C") % identical % stringpatterncompare("move $A from $B to $C", "move Tim from work to Home") % identical % stringpatterncompare("move $A from $B to $C", "move $A from work to Home") % empty results % % % See also: stringpatternreplace, XPSGPS, XPSGPSEQ, stringpatterncondition % % % Copyright 2023 Tim C. Lueth |
XPSblocksworldequation- RULES for the XPSEQS blockworld problem |
% XPSblocksworldequation - RULES for the XPSEQS blockworld problem % (by Tim Lueth, VLFL-Lib, 2023-NOV-30 as class: ARTIFICIAL INTELLIGENCE) % % This creates simple the test data for the GPS=AI with respect to to % Peter Norvig (1991) using the STRIPS Rules % % It can be used to define similar knowledge action rules (Status of: % 2024-02-03) % % Introduced first in SolidGeometry 5.4 % % See also: XPSGPS, XPSEQS, XPSblocksworld, XPSslidingpuzzle, XPSlawcase % % LITERATURE: % - Norvig, Peter (1991): Paradigms of Artificial Intelligence % Programming, Morgan Kaufmann Publisher, San Mateo, CA, USA % % [ops,start,finish]=XPSblocksworldequation % === OUTPUT RESULTS ====== % ops: cell list [n x 4] describing action-name, precondition, add-state, % diff-state % start: string array describing the start state % finish: string array describing the final state % % EXAMPLE: [ops,start,finish]=XPSblocksworldequation % Example efinitions of operators start-state and goal-state % XPSGPS(ops, start, finish) % % % See also: XPSGPS, XPSEQS, XPSblocksworld, XPSslidingpuzzle, XPSlawcase % % % Copyright 2023-2024 Tim C. Lueth |
XPSEQS(ops,start,finish,"debug","first")- Expert System implementing the first General Problem Solver (AI Programm) |
% XPSEQS(ops,start,finish,"debug","first") - Expert System implementing the first General Problem Solver (AI Programm) % (by Tim Lueth, VLFL-Lib, 2023-NOV-29 as class: ARTIFICIAL INTELLIGENCE) % % Order of parameters changed in Feb 2024 % In contrast to XPSGPS, this fnctn XPSEQS supports also equations based % on $Var symbols. the delete list is applied before the add list, to % allow the termination by adding removed facts % IF COND(STATE)==TRUE; NEWSTATE = [SETDIFF(STATE, DELLIST),ADDLIST) % Since 2024, also Equations or matlab code can be evaluated such as % "$A==4" or "$L==$R-1" % (Status of: 2024-01-20) % % Introduced first in SolidGeometry 5.4 % % See also: XPSblocksworld, XPSGPS, XPSconditionfindneval, % XPSslidingpuzzle, XPSlawcase % % LITERATURE: % - Norvig, Peter (1991): Paradigms of Artificial Intelligence % Programming, Morgan Kaufmann Publisher, San Mateo, CA, USA % % [solut,endstate,solutstates,plan]=XPSEQS([ops,start,finish,"debug","fir % st"]) % === INPUT PARAMETERS === % ops: cell list [n x 4] describing action-name, precondition, add-state, % diff-state % start: string array describing the start state % finish: string array describing the final state % "debug": if used, the progress is shown % "first": if used, the first solution is returned % === OUTPUT RESULTS ====== % solut: solutions % endstate: end state of the solutioin % solutstates: state change of the solutions % plan: all plans generated % % EXAMPLE: % clc; [ops,start,finish]=XPSblocksworld % Example efinitions of operators start-state and goal-state % opsnew={["move $A from $B to $C"], ["space on $A", "space on $C", "$A on $B"], ["$A on $C", "space on $B" "space on table"], ["$A on $B", "space on $C"]} % ACTION, COND, ADD, DEL % XPSEQS(ops, start, finish); % XPSEQS(opsnew, start, finish); % % % See also: XPSblocksworld, XPSGPS, XPSconditionfindneval, % XPSslidingpuzzle, XPSlawcase % % % Copyright 2023-2024 Tim C. Lueth |
XPSblocksworld- Expert System implementing the first General Problem Solver (AI Programm) |
% XPSblocksworld - Expert System implementing the first General Problem Solver (AI Programm) % (by Tim Lueth, VLFL-Lib, 2023-NOV-25 as class: ARTIFICIAL INTELLIGENCE) % % This creates simple the test data for the GPS=AI with respect to to % Peter Norvig (1991) % % It can be used to define similar knowledge action rules (Status of: % 2024-01-10) % % Introduced first in SolidGeometry 5.4 % % See also: XPSGPS, XPSEQS, XPSblocksworldequation, XPSslidingpuzzle, % XPSlawcase % % LITERATURE: % - Norvig, Peter (1991): Paradigms of Artificial Intelligence % Programming, Morgan Kaufmann Publisher, San Mateo, CA, USA % % [ops,start,goal]=XPSblocksworld % === OUTPUT RESULTS ====== % ops: cell list [n x 4] describing action-name, precondition, add-state, % diff-state % start: string array describing the start state % goal: string array describing the final state % % EXAMPLE: % [ops,start,finish]=XPSblocksworld % Example efinitions of operators start-state and goal-state % XPSGPS(ops,start, finish) % % % See also: XPSGPS, XPSEQS, XPSblocksworldequation, XPSslidingpuzzle, % XPSlawcase % % % Copyright 2023-2024 Tim C. Lueth |
XPSGPS(ops,start,finish)- Expert System implementing the first General Problem Solver (AI Programm) using STRIPS |
% XPSGPS(ops,start,finish) - Expert System implementing the first General Problem Solver (AI Programm) using STRIPS % (by Tim Lueth, VLFL-Lib, 2023-NOV-24 as class: ARTIFICIAL INTELLIGENCE) % % This is a tutorial how to design general problem solver expert systems, % that use % 1st - states as array of strings % 2nd - operators as cell list of actions, predconditions, add-states and % delete-states % All states are strings not chars % State list are arrays of strings % (Status of: 2023-12-09) % % Introduced first in SolidGeometry 5.4 % % See also: XPSblocksworld, XPSEQS % % LITERATURE: % - Norvig, Peter (1991): Paradigms of Artificial Intelligence % Programming, Morgan Kaufmann Publisher, San Mateo, CA, USA % % [solut,plan]=XPSGPS([ops,start,finish]) % === INPUT PARAMETERS === % ops: cell list [n x 4] describing action-name, precondition, add-state, % diff-state % start: string array describing the start state % finish: string array describing the final state % === OUTPUT RESULTS ====== % solut: solution - successful plans % plan: complete plan list % % EXAMPLE: % clc; [ops,start,finish]=XPSblocksworld % Example efinitions of operators start-state and goal-state % XPSGPS(ops ,start, finish) % % % % See also: XPSblocksworld, XPSEQS % % % Copyright 2023-2024 Tim C. Lueth |
XPpermute(sc,lists)- Auxiliary fnct to create permutation of sets |
% XPpermute(sc,lists) - Auxiliary fnct to create permutation of sets % (by Tim Lueth, VLFL-Lib, 2023-NOV-17 as class: ARTIFICIAL INTELLIGENCE) % % Introduced first in SolidGeometry 5.4 % % See also: permutevarargin, join, XPS % % LITERATURE: % - Norvig, Peter (1991): Paradigms of Artificial Intelligence % Programming, Morgan Kaufmann Publisher, San Mateo, CA, USA % % LL=XPpermute([sc,lists]) % === INPUT PARAMETERS === % sc: separator; default is '' % lists: cell lists of arguments % === OUTPUT RESULTS ====== % LL: cell list of all combinations of the permutation % % EXAMPLE: % XPpermute(' ',{'ISBIGGER'},{'DOG', 'CAT', 'BIRD', 'LION', 'ELEPHANT'}, {'DOG', 'CAT', 'BIRD', 'LION', 'ELEPHANT'}); XX=ans % % See also: permutevarargin, join, XPS % % % Copyright 2023 Tim C. Lueth |
permutezzlist(zzlist)- creates multidimensional index sequences for testing or other purposes |
% permutezzlist(zzlist) - creates multidimensional index sequences for testing or other purposes % (by Tim Lueth, VLFL-Lib, 2023-NOV-17 as class: AUXILIARY PROCEDURES) % % much faster than permutevector, similar but more generic than % indexvariant (Status of: 2023-11-17) % % Introduced first in SolidGeometry 5.4 % % See also: permutevector, indexvariant, permutevarargin, join, split, % XPpermute % % LITERATURE: % - Norvig, Peter (1992): Paradigms of Artificial Intelligence % Programming, Morgan Kaufmann Publisher, San Mateo, CA, USA % % zz=permute[zzlist]([zzlist]) % === INPUT PARAMETERS === % zzlist: row or col vector; default is [1 2 3] % === OUTPUT RESULTS ====== % zz: index field [numel(vec)^dim x dim] % % EXAMPLE: % permutevarargin({'a' 'b' 'c' 'd'}, {'X' 'Y'} ,{1 2 3}) % permutevarargin({'a' 'b' 'c' 'd'}, {'X' 'Y'} ,{'1' '2' '3'}) % permutevarargin({'a' 'b' 'c' 'd'}, {'X' 'Y'} ,{'1' '2' '3'}); XX=ans, join(XX,'-') % permutevarargin({'a' 'b' 'c' 'd'}, {'X' 'Y'} ,{'1' '2' '3'}); XX=ans, cell2dataset(XX,'VarNames' {'FUNC','PAR1','PAR2'}) % permutevarargin([1 2 3],[4 5 6],[7 8 9]) % permutevarargin({'ISBIGGER'},{'DOG', 'CAT', 'BIRD', 'LION', 'ELEPHANT'}, {'DOG', 'CAT', 'BIRD', 'LION', 'ELEPHANT'}) % % See also: permutevector, indexvariant, permutevarargin, join, split, % XPpermute % % % Copyright 2023 Tim C. Lueth |
unsortrows(A)- swaps many different rows of a matrix |
% unsortrows(A) - swaps many different rows of a matrix % (by Tim Lueth, VLFL-Lib, 2023-NOV-03 as class: AUXILIARY PROCEDURES) % % same as ELunsort (Status of: 2023-11-03) % % Introduced first in SolidGeometry 5.4 % % See also: ELunsort, sortrows, unsortNaN % % A=unsortrows(A) % === INPUT PARAMETERS === % A: Original matrix % === OUTPUT RESULTS ====== % A: unosrted matrix, randomly exchnanged rows % % EXAMPLE: % A=sortrows(round(10*rand(10,4)),2), unsortrows(A) % % % See also: ELunsort, sortrows, unsortNaN % % % Copyright 2023 Tim C. Lueth |
SGbraitenbergvehicle(BLH,COL,NAM)- creates a simple solid similar to the vehicles of von Braitenberg |
% SGbraitenbergvehicle(BLH,COL,NAM) - creates a simple solid similar to the vehicles of von Braitenberg % (by Tim Lueth, VLFL-Lib, 2023-OKT-22 as class: PARAMETRIC DESIGN) % % The center is between the wheels (Status of: 2023-10-22) % % Introduced first in SolidGeometry 5.4 % % See also: sprintftext, SGofCPLcommand, SGtextstamp, TofWheel, % VehicleLearning.mlx % % SG=SGbraitenbergvehicle([BLH,COL,NAM]) % === INPUT PARAMETERS === % BLH: [Widht length height]l default is [30 40 10] % COL: Optional colors for sensor wheel text; default is [yrc] % NAM: optional name ontop; default is empty; % === OUTPUT RESULTS ====== % SG: Solid Geometry % % EXAMPLE: % SGbraitenbergvehicle([20 20 10],'yr','JIMMY'); SGR=ans; % TR=eye(3); hr=[]; % for i=1:100 % d=rand(1,2)/5; % robot creates random numbers for the wheel movement % % Create robot animation % TR=TR*TofWheel(30,d); delete(hr); hr=SGplotalpha(SGtransT(SGR,T3ofT2(TR))); % axis tight; view(-30,30); drawnow; % end % % See also: sprintftext, SGofCPLcommand, SGtextstamp, TofWheel, % VehicleLearning.mlx % % % Copyright 2023 Tim C. Lueth |
fcostbenefit(c,r,t)- cost or benefit fnct |
% fcostbenefit(c,r,t) - cost or benefit fnct % (by Tim Lueth, VLFL-Lib, 2023-OKT-14 as class: AUXILIARY PROCEDURES) % % Introduced first in SolidGeometry 5.4 % % See also: VehicleReinforce.mlx % % [ff,PL,SG]=fcostbenefit([c,r,t]) % === INPUT PARAMETERS === % c: [plateau-width center-shift center-value]; default is [0 0 1] % r: [ramp width and minimal value[ ;default is [2 0] % t: type of functiopn "lin", "atan", "bell"; default is bell (1/1+x^2) % === OUTPUT RESULTS ====== % ff: handle to cost equation % PL: Point list of fnctn % SG: Solid Geometry of fnctn % % EXAMPLE: % fcostbenefit([10 0],10,'bell'); ff=ans; axis equal, ff(4) % fcostbenefit([10 2],10,'atan'); ff=ans; axis equal, ff(8) % fcostbenefit([10 2],10,'bell'); ff=ans; axis equal, ff(8) % fcostbenefit([1 4],2,'bell'); ff=ans; axis normal; ff(10) % % See also: VehicleReinforce.mlx % % % Copyright 2023 Tim C. Lueth |
SGof2Dfunc(ff,ax,res,D)- creates a surface or a solid of a 1D or 2D fnct |
% SGof2Dfunc(ff,ax,res,D) - creates a surface or a solid of a 1D or 2D fnct % (by Tim Lueth, VLFL-Lib, 2023-OKT-14 as class: SURFACES) % % Introduced first in SolidGeometry 5.4 % % See also: SGofGeoTIFF, SGofSurface, VLwarpgrid, FLofVLmeshgrid % % SG=SGof2Dfunc([ff,ax,res,D]) % === INPUT PARAMETERS === % ff: handle to the fnctn; default is @sin % ax: axis [xmin xmax ymin ymax]; default is [-10 10 -10 10] % res: step size; default is max(dy,dy)/99; % D: Socket height; default is '' ==> only surface % === OUTPUT RESULTS ====== % SG: Solid Geometry % % EXAMPLE: % SGof2Dfunc(@cos,[-pi 2*pi -pi 3*pi],.1); SG=ans; % creates just the surface without thickness % SGofSurface(SG.VL,SG.FL,0.5) % creates a solid from the surface % % SGof2Dfunc(@cos,[-pi 2*pi -pi 3*pi],.1,0) % creates a solid with no socket % SGof2Dfunc(@cos,[-pi 2*pi -pi 3*pi],.1,1) % creates a solid plus socket % % zzz=@(x,y) x+y % SGof2Dfunc(zzz,[-pi 2*pi -pi 3*pi],.1,1) % creates a solid plus socket % SGof2Dfunc(str2func('@(x,y)x*x-y*y'),[-1 1 -1 1],.1,1) % creates a solid plus socket % view(0,90); viewsmooth(-30,30,200) % % % See also: SGofGeoTIFF, SGofSurface, VLwarpgrid, FLofVLmeshgrid % % % Copyright 2023 Tim C. Lueth |
PLwrench(D,n)- exactly the same as PLinbus |
% PLwrench(D,n) - exactly the same as PLinbus % (by Tim Lueth, VLFL-Lib, 2023-OKT-13 as class: CLOSED POLYGON LISTS) % % Introduced first in SolidGeometry 5.4 % % See also: PLhexalobular, PLinbus, PLcircle, PLcircseg, PLevolvente, % PLgearDIN, PLhelix, PLkidney, PLrand, PLspiral, PLsquare, PLstar, % PLcircleoval, PLtubbing, PLarrow, CPLcirclesofPL % % [PL,Rm]=PLwrench([D,n]) % === INPUT PARAMETERS === % D: DIAMETER NOT RADIUS! default is 1/4 Inch % n: number of faces; default is 6 % === OUTPUT RESULTS ====== % PL: Point list % Rm: Radius of circle for PLcircle % % EXAMPLE: % PLwrench(10) % % See also: PLhexalobular, PLinbus, PLcircle, PLcircseg, PLevolvente, % PLgearDIN, PLhelix, PLkidney, PLrand, PLspiral, PLsquare, PLstar, % PLcircleoval, PLtubbing, PLarrow, CPLcirclesofPL % % % Copyright 2023 Tim C. Lueth |
SGjuicerAdapter(Do,Di)- creates a spare part for a BOSCH juicer |
% SGjuicerAdapter(Do,Di) - creates a spare part for a BOSCH juicer % (by Tim Lueth, VLFL-Lib, 2023-OKT-13 as class: PARAMETRIC DESIGN) % % Introduced first in SolidGeometry 5.4 % % See also: SGbookwedge, SGshieldbase % % SGjuicerAdapter([Do,Di]) % === INPUT PARAMETERS === % Do: Outer Diameter % Di: Inner Diameter % % See also: SGbookwedge, SGshieldbase % % % Copyright 2023 Tim C. Lueth |
TofWheel(D,w)- returns a HT matrix for a 2 wheel kinematic movement |
% TofWheel(D,w) - returns a HT matrix for a 2 wheel kinematic movement % (by Tim Lueth, VLFL-Lib, 2023-OKT-10 as class: KINEMATICS AND FRAMES) % % USE CAREFULLY: TofWheel was not being tested extensively % % Used in Braitenberg vehicle examples (Status of: 2023-10-12) % % Introduced first in SolidGeometry 5.4 % % See also: TofDPhi, TofDPhiH % % [TS,PL,TR,TL]=TofWheel(D,[w]) % === INPUT PARAMETERS === % D: Distance between the two weels in x % w: movement in rad % === OUTPUT RESULTS ====== % TS: Center Frame after movement % PL: path of movement % TR: Frame of result of right wheel % TL: Frame of result of left wheel % % EXAMPLE: % TofWheel(30,[0 270]/180*pi) % % SGR=SGofCPLcommand("b 30 40,h 10, enter, sph 10, rel center, rel alignback 5, rel alignleft -2,swap, enter, sph 10, rel center, rel alignback 5, rel alignright -2,add, swap , add, enter, c 12, h 5,roty 90,rel alignbottom 1, rel alignleft 5, rel infront -5, add, enter, c 12, h 5,roty 90,rel alignbottom, rel alignright 5, rel alignfront, add"); % TR=eye(3) % for i=1:100 % d=rand(1,2)/5; % robot creates random numbers for the wheel movement % % Create robot animation % TR=TR*TofWheel(30,d); delete(hr); hr=SGplotalpha(SGtransT(SGR,T3ofT2(TR)),'g',0.5); % axis tight; view(-30,30); drawnow; % end % % % See also: TofDPhi, TofDPhiH % % % Copyright 2023 Tim C. Lueth |
SGshieldbase(ddd,rrr)- creates a shieldbase |
% SGshieldbase(ddd,rrr) - creates a shieldbase % (by Tim Lueth, VLFL-Lib, 2023-OKT-04 as class: PARAMETRIC DESIGN) % % Introduced first in SolidGeometry 5.4 % % See also: SGbookwedge % % SG=SGshieldbase([ddd,rrr]) % === INPUT PARAMETERS === % ddd: [length widht height tickness]; default is [117 4 60 2] % rrr: [stand extension stand height]; default is [10 4] % === OUTPUT RESULTS ====== % SG: resulting solid % % See also: SGbookwedge % % % Copyright 2023 Tim C. Lueth |