The Options Approach to Software Prototyping Decisions

合集下载

DIN-ODE Mk2 用户手册说明书

DIN-ODE Mk2 用户手册说明书

Box Contents∙DIN-ODE Mk2 (PN: 71020 or 71021)∙This user manual (available online) Features∙ 1 Universe Ethernet to DMX node (Output mode) ∙ 1 Universe DMX to Ethernet (Input mode)∙Easy to setup & update through any webbrowser∙Supports following DMX over Ethernet proto-cols:o Art-Neto Streaming ACN (sACN)o ESP∙Supports RDM over Art-Net (controller)∙Supports Art-Net 3∙HTP/LTP Merging support: up-to 2 DMX sources can be merged (if enabled).∙ 1 RJ45 connector (10/100 Mbps)∙Static or Dynamic (DHCP) IP configuration (DHCP by default)∙POE (Power over Ethernet) supported RJ45 con-nector (only on POE model PN 71021)∙DIN-Rail compatible∙Supports Broadcast or Unicast (Input mode)∙Machined aluminium box, made to last.∙Phoenix DIN Connectors Safety∙Do not expose the DIN-ODE Mk2 to rain or moisture, doing this will void the warranty∙This unit is intended for indoor use onlyBasic SetupRight out of the box, the DIN-ODE Mk2 is factory configured to be a DMX OUTPUT device, listening to the first Art-Net Universe (0x00). It is also set as a DHCP node, so you can plug it into your existing router, and it's good to go.To make any changes to the configuration, you will need the IP address of DIN-ODE Mk2. ENTTEC provides a free App (available for Windows and Mac) called NMU, which will find the DIN-ODE on your network and display its IP address.Using the IP address one can access the built-in web-inter-face inside the ODE via any modern web-browser. The web-interface allows the settings of the unit to be changed. Once setup, any Art-Net/sACN/ESP enabled software/app or a lighting control/desk can be used to send DMX out of the ODE. For a list of recommended apps, please check the website /din-ode2Dip-Switch: There is a dip-switch inside the unit, accessible by removing the top cover. Switch 1, when engaged termi-nates the DMX output. Useful, if the unit is used at the end of a DMX chain, to terminate the DMX signal. By default, switch 1 is off. Switch 2 is not connected, and has no effect when engaged or not.LED StatusThe DIN-ODE Mk2 comes with four LED indicators located between the DC power jack and the RJ45 connector.1.STAT (Status): Blinks to indicate the following:∙Blinks once per second: normal operation∙Blinks more than once a second: multiplesources detected, or requires firmware.2.DIR (Port Direction): The LED will be ON whenthe DMX port is in Output mode, and OFF whenthe DMX port is in input mode.3.LINK: This LED will be ON when there is anEthernet Link.4.ACT: This LED blinks when there is activity on theEthernet network.NMUNMU (Node Management Utility) is a free Windows and Mac application that is used to manage compatible ENTTEC DMX over Ethernet nodes.NMU will help you find your unit's IP address and then open a browser window to access the web-interface.Please follow these steps:1.Download NMU from /nmu2.Ensure that your DIN ODE Mk2 is hooked upphysically by an Ethernet cable.3.And connected to the same physical network(or router) as the computer on which you willrun NMU.4.Open NMU. If prompted with multiple networks,select the correct network. (identified by the IPaddress of your computer on that network)5.Press the Discovery button, and wait till NMUfinds all supported ENTTEC devices on yournetwork.6.Once found, select ODE and use the IP address toaccess the web-interface via your web browser.Web ConfigurationThe DIN-ODE Mk2 can be configured and controlled through a web browser, running on a computer system, located on the same Local Area Network. Any modern web browser, such as Chrome, Firefox, Internet Explorer, Safari or Opera, running under any operating system, including Windows 7/8, Mac OS X or Linux can be used.Either click on the underlined url displayed, or type the IP address (as detected by NMU) into your web browser to ac-cess the ODE Web Interface. The left side menu allows allthe ODE web pages to be accessed. Home page provides the following information:System Information: Name, Firmware Version and Serial No. of the unit. The Serial No. is unique to this unit and can be used to identify this unit.Current Network Settings: Configured IP address and Link speed for the unit.Current Port Settings: Configured Port Type, Protocol and Universe for the unit. This serves as a quick place to check all the Port related settings.Current DMX buffer: allows you to see the current DMX values for the Port. The buffer is a snapshot only, but can be refreshed manually.To change any of the displayed settings, you must use the Settings page.Network SettingsNode name is used to identify the ODE on the network. Any meaningful name can be used.DHCP is enabled by default. When enabled, the router on your network is expected to automatically provide the IP address to the ODE. If no DHCP router/server is present on the network, the manual IP address will be used.If for some reason, your unit does not get an IP address via DHCP, please restart the ODE with the Ethernet cable connected. It will listen for DHCP on start-up and wait for a few seconds, before giving up. IP Address and Netmask are only used if DHCP is disabled or is unavailable on your network. ODE web-page will warn you, if non-standard IP address or netmask is used.If ever you manage to use an IP Address that can't be con-nected to later, please perform the reset procedure (as de-scribed later). The reset will re-enable DHCP on ODE. Input Send Mode: allows you to pick either broadcasting or a specified unicast IP address. Broadcast address is based on the subnet mask shown.Art-Net Address: Net and Subnet can be selected here, and comply with Art-Net 3 protocol. Universe can be selected from the DMX Port Settings.sACN CID: The current CID for ODE is displayed here, and will be use in all sACN communication.DMX Port SettingsPort Types:∙Output: Ethernet to DMX Output, based on the se-lected protocol.∙Input: DMX Input to Ethernet, sends the selected protocol on the network.∙Disabled: Does not process any DMX (input or out-put).∙RDM Enabled: Enables RDM over Art-Net support on the port. Only available when Art-Net is selectedand Port Type is output.Protocol and Universe must be selected to match the set-tings of the remote sender or receiver connected to the LAN.Refresh RateThe rate at which ODE will output the Data from DMX port (40 Frames per second is default). It will repeat the last re-ceived LAN frame to comply with DMX standard. However, if you do not want to repeat the last frame use “follow source”as the refresh rate. This option will match the rate at which the source sends at.Merging SupportMerging option is only available when port is set to Output. Any incoming DMX on the same universe, but from different IP addresses is treated as a separate DMX source.Available Merging options:∙Disabled: only one source should be sending to the DMX output. Using multiple sources will cause a conflict and the output might have unex-pected data.∙HTP Merge (by default): Highest Takes Prece-dence. Channels are compared one to one and the highest value is set on the output. Merging is limited to two sources, any additional sources will be ignored by ODE. If either one of the 2 sources of DMX stop, the failed source is held in the merge buffer for 4 seconds. If, during the 4 second timeout, the failed source returns, Merg-ing continues.∙LTP Merge: Latest Takes Precedence. The latestsource is used as the output. The source thathasn’t been received for 4 seconds or more, willbe discarded.∙Merging conflict: if more than two sources are sending data to ODE on the same universe, ODEwill indicate a conflict. A warning will be dis-played on the home-page, and i t’s also indicatedby the status led blinking faster than normal.Unicast optionSend DMX to a single IP address rather than broadcast. Unicast is only available when port is set to Input. Any valid IP address can be used to Unicast DMX.Save or ResetTo save all the changes made, please click on Save Set-tings and wait for ODE to confirm (takes up-to 5 seconds). Once confirmed you will be taken to the home-page.Reset to defaults, will put all the settings back to their default values (network & port settings). ODE will be re-set to Factory condition.Reboot – will restart the ODE. Please allow a few seconds, and the page will refresh, when ODE is ready. Update FirmwareFrom this page you can update ODE to the latest firm-ware. Latest firmware file is available at /din-ode2.Please use the correct firmware file.Choose or browse the firmware file (as per your browser) and click on Update firmware to start the process. The update progress is shown in real-time, and will take a few seconds for the update to complete When the update is complete, the page will refresh and you will be taken to the home page – where you can verify the firmware version. If the update fails for any reason, pleasetry the same process again.ODE will reboot after a firmware update, please allow a few seconds for it to be refreshed in the browser. Please wait until the update process is complete.Art-Net Send TestNMU can also be used to troubleshoot the DMX output on your ODE. Art-Net Test can be accessed from the top menu: Art-net → Art-net TestWhen first opened, the Art-Net is set to Disabled, please set it to Enabled, and then you can use either the DMX faders to test one or more DMX channels, or use the test-patterns from the options available.Please set the ODE to be Art-Net output and on the same universe as being used to send Art-Net from NMU.SpecificationsDue to continuous improvements and innovations of all ENTTEC products, specifications and features are subject to change without notice.Item ValueInput Voltage 7-24V DCNominal Current 300 mASupported Protocols DMX512A / RDM / ArtNet / sACN / ESPLength: 4.21” / 107mmHeight 2.24” / 57mmWidth 2.71” / 69mmUnit Weight0.46bs / 210gShipped Weight0.55bs / 250gOperatingEnvironment0° to 50°CConnectors 1x 3pin Screw Terminal for Data1x 2pin Screw Terminal for Power1x RJ45 connector for Ethernet Ordering InformationThe ENTTEC ODE and compatible products can be ordered from our website or through your ENTTEC dealer.PN Description71020DIN-ODE Mk271021DIN-ODE POE Mk279111Autoswitching power supply 7V(universal)79111-USAutoswitching power supply 7V(US only)Wiring AdviceThe Enttec DIN-ODE Mk2 DMX data phoenix connector, can be double wired (thereby making a pass-through). whereby two wires may be connected to each terminal in order to approximate a daisy chain (with no more than 32 devices). Engage the dip-switch 1 to terminate the DMX signal, on the last unit on the daisy chain.Email: sale s@e ntt ec.co mWebsite: 。

prototest 1.2 产品说明书

prototest 1.2 产品说明书

Package‘prototest’October14,2022Type PackageTitle Inference on Prototypes from Clusters of FeaturesVersion1.2Date2019-02-02Author Stephen ReidMaintainer Stephen Reid<*******************>Depends intervals,MASS,glmnetDescription Procedures for testing for group-wide signal in clusters of variables.Tests can be per-formed for single groups in isolation(univariate)or multiple groups together(multivariate).Spe-cific tests include the exact and approximate(un)selective likelihood ratio tests de-scribed in Reid et al(2015),the selective F test and marginal screening proto-type test of Reid and Tibshirani(2015).User may pre-specify columns to be included in proto-type formation,or allow the function to select them itself.A mixture of these two is also possi-ble.Any variable selection is accounted for using the selective inference framework.Op-tions for non-sampling and hit-and-run null reference distributions.License GPL(>=2)Imports Rcpp(>=0.12.1)LinkingTo Rcpp,RcppArmadilloURL /abs/1511.07839NeedsCompilation yesRepository CRANDate/Publication2019-02-0311:00:03UTCR topics documented:prototest-package (2)print.prototest (3)prototest.multivariate (5)prototest.univariate (8)Index1112prototest-package prototest-package Inference on Prototypes from Clusters of FeaturesDescriptionProcedures for testing for group-wide signal in clusters of variables.Tests can be perfromed for single groups in isolation(univariate)or multiple groups together(multivariate).Specific tests include the exact and approximate(un)selective likelihood ratio(ELR,ALR)tests described in Reid et al(2015),the selective F test and marginal screening prototype test of Reid and Tibshirani (2015).User may prespecify columns to be included in prototype formation,or allow the function to select them itself.A mixture of these two is also possible.Any variable selection is accounted for using the selective inference framework introduced in Lee et al(2013)and further developed in Lee and Taylor(2014).Options for non-sampling and hit-and-run null reference distrbutions.Tests are examples of selected model tests,a notion introduced in Fithian et al(2015).DetailsPackage:prototestType:PackageVersion: 1.0Date:2015-11-12License:GPL(>=2)Only two functions provided:prototest.univariate(for tests with a single group in isolation) and prototest.multivariate(for tests with multiple groups simultaneously).Each function pro-vides options to perform one of the ELR,ALR,F or marginal screening prototype er may specify which columns are to be used in prototype construction,or leave it for the function to select.Valid tests are performed in the event of variable er has option to use non-sampling null reference distributions(where available)or hit-and-run references.Author(s)Stephen ReidMaintainer:Stephen Reid<******************>ReferencesReid,S.and Tibshirani,R.(2015)Sparse regression and marginal testing using cluster prototypes./pdf/1503.00334v2.pdf.Biostatistics doi:10.1093/biostatistics/kxv049 Reid,S.,Taylor,J.and Tibshirani,R.(2015)A general framework for estimation and inference from clusters of features.Available online:/abs/1511.07839Lee,J.D.,Sun,D.L.,Sun,Y.and Taylor,J.E.(2013)Exact post-selection inference,with application to the lasso./pdf/1311.6238v6.pdf.Annals of Statistics(to appear)Lee,J.D.and Taylor,J.E.(2014)Exact Post Model Selection Inference for Marginal Screening./pdf/1402.5596v2.pdfFithian,W.,Sun,D.L.and Taylor,J.E.(2015)Optimal Inference After Model Selection.http: ///pdf/1410.2597v2.pdfExamplesrequire(prototest)###generate dataset.seed(12345)n=100p=80X=matrix(rnorm(n*p,0,1),ncol=p)beta=rep(0,p)beta[1:3]=0.1#three signal variables:number1,2,3signal=apply(X,1,function(col){sum(beta*col)})intercept=3y=intercept+signal+rnorm(n,0,1)###treat all columns as if in same group and test for signal#non-selective ELR test with nuisance interceptelr=prototest.univariate(X,y,"ELR",selected.col=1:5)#selective F test with nuisance intercept;non-samplingf.test=prototest.univariate(X,y,"F",lambda=0.01,hr.iter=0)print(elr)print(f.test)###assume variables occur in4equally sized groupsnum.groups=4groups=rep(1:num.groups,each=p/num.groups)#selective ALR test--select columns21-25in2nd group;test for signal in1st;hit-and-run alr=prototest.multivariate(X,y,groups,1,"ALR",21:25,lambda=0.005,hr.iter=20000) #non-selective MS test--specify first column in each group;test for signal in1st ms=prototest.multivariate(X,y,groups,1,"MS",c(1,21,41,61))print(alr)print(ms)print.prototest Print prototest objectDescriptionGeneric print method for prototest objectsUsage##S3method for class prototestprint(x,...)Argumentsx object of type prototest....other parameters passed to print function.DetailsPrints the test statistic and p-value associated with the prototest object x. Author(s)Stephen ReidSee Alsoprototest.univariate,prototest.multivariateExamplesrequire(prototest)###generate dataset.seed(12345)n=100p=80X=matrix(rnorm(n*p,0,1),ncol=p)beta=rep(0,p)beta[1:3]=2#three signal variables:number1,2,3signal=apply(X,1,function(col){sum(beta*col)})intercept=3y=intercept+signal+rnorm(n,0,1)###treat all columns as if in same group and test for signal#non-selective ELR test with nuisance interceptelr=prototest.univariate(X,y,"ELR",selected.col=1:5)print(elr)prototest.multivariatePerform Prototype or F tests for Significance of Groups of Predictorsin the Multivariate ModelDescriptionPerform prototype or F tests for significance of groups of predictors in the multivariate model.Choose either exact or approximate likelihood ratio prototype tests(ELR)or(ALR)or F test or marginal screening prototype test.Options for selective or non-selective tests.Further options for non-sampling or hit-and-run reference distributions for selective tests.Usageprototest.multivariate(x,y,groups,test.group,type=c("ELR","ALR","F","MS"), selected.col=NULL,lambda,mu=NULL,sigma=1,hr.iter=50000,hr.burn.in=5000,verbose=FALSE,tol=10^-8)Argumentsx input matrix of dimension n-by-p,where p is the number of predictors over all predictor groups of interest.Will be mean centered and standardised before testsare performed.y response variable.Vector of length n,assumed to be quantitative.groups group membership of the columns of x.Vector of length p,which each element containing the goup label of the corresponding column in x.test.group group label for which we test nullity.Should be one of the values seen in groups.See Details for further explanation.type type of test to be performed.Can select one at a time.Options include the exact and approximate likelihood ratio prototype tests of Reid et al(2015)(ELR,ALR),the F test and the marginal screening prototype test of Reid and Tibshirani(2015)(MS).Default is ELR.selected.col preselected columns selected by the user.Vector of indices in the set{1,2,...p}.Used in conjunction with groups to ascertain for which groups the user hasspecified selected columns.Should itfind any selected columns within a group,no further action is taken to select columns.Should no columns within a groupbe specified,columns are selected using either lasso or the marginal screeningprocedure,depending on the test.If all groups have prespecified columns,anon-selective test is performed,using the classical distributional assumptions(exact and/or asymptotic)for the test in question.If any selection is performed,selective tests are performed.Default is NULL,requiring the selection of columnsin all the groups.lambda regularisation parameter for the lassofit.Same for each group.Must be supplied when at least one group has unspecified columns in selected.col.Will besupplied to glmnet.This is the unstandardised version,equivalent to lambda/nsupplied to glmnet.mu mean parameter for the response.See Details below.If supplied,it isfirst subtracted from the response to yield a zero-mean(at the population level)vectorfor which we proceed with testing.If NULL(the default),this parameter is treatedas nuisance parameter and accounted for as such in testing.sigma error standard deviation for the response.See Details below.Must be supplied.If not,it is assumed to be1.Required for computation of some of the teststatistics.hr.iter number of hit-and-run samples required in the reference distribution of the a selective test.Applies only if selected.col is NULL.Default is50000.Sincedependent samples are generated,large values are required to generate goodreference distributions.If set to0,the function tries to applu a non-samplingselective test(provided selected.col is NULL),if possible.If non-samplingtest is not possible,the function exits with a message.hr.burn.in number of burn-in hit-and-run samples.These are generatedfirst so as to make subsequent hit-and-run realisations less dependent on the observed response.Samples are then discarded and do not inform the null reference distribution.verbose should progress be printed?tol convergence threshold for iterative optimisation procedures.DetailsThe model underpinning each of the tests isy=µ+Kk=1θk·ˆy k+where ∼N(0,σ2I)and K is the number of predictor groups.ˆy k depends on the particular test considered.In particular,for the ELR,ALR and F tests,we haveˆy k=P Mk (y−µ),where P Mk=X MkXM kX Mk−1XM k.X M is the input matrix reduced to the columns with indices in the set M.M k is the set of indices selected from considering group k of predictors in isolation.This set is either provided by the user (via selected.col)or is selected automatically(if selected.col is NULL).If the former,a non-selective test is performed;if the latter,a selective test is performed,with the restrictions Ay≤b, as set out in Lee et al(2015)and stacked as in Reid and Tibshirani(2015).For the marginal screening prototype(MS)test,ˆy k=x j∗where x j is the j th column of x and j∗=argmax j∈Ck|x j y|,where C k is the set of indices in the overall predictor set corresponding to predictors in the k th group.All tests test the null hypothesis H0:θk∗=0,where k∗is supplied by the user via test.group.Details of each are described in Reid et al(2015).ValueA list with the following four components:ts The value of the test statistic on the observed data.p.val Valid p-value of the test.selected.col Vector with columns selected for prototype formation in the test.If initially NULL,this will now contain indices of columns selected by the automatic columnselection procedures of the test.y.hr Matrix with hit-and-run replications of the response.If sampled selective test was not performed,this will be NULL.Author(s)Stephen ReidReferencesReid,S.and Tibshirani,R.(2015)Sparse regression and marginal testing using cluster prototypes./pdf/1503.00334v2.pdf.Biostatistics doi:10.1093/biostatistics/kxv049 Reid,S.,Taylor,J.and Tibshirani,R.(2015)A general framework for estimation and inference from clusters of features.Available online:/abs/1511.07839.See Alsoprototest.univariateExamplesrequire(prototest)###generate dataset.seed(12345)n=100p=80X=matrix(rnorm(n*p,0,1),ncol=p)beta=rep(0,p)beta[1:3]=0.1#three signal variables:number1,2,3signal=apply(X,1,function(col){sum(beta*col)})intercept=3y=intercept+signal+rnorm(n,0,1)###treat all columns as if in same group and test for signal#non-selective ELR test with nuisance interceptelr=prototest.univariate(X,y,"ELR",selected.col=1:5)#selective F test with nuisance intercept;non-samplingf.test=prototest.univariate(X,y,"F",lambda=0.01,hr.iter=0)print(elr)print(f.test)###assume variables occur in4equally sized groupsnum.groups=4groups=rep(1:num.groups,each=p/num.groups)#selective ALR test--select columns21-25in2nd group;test for signal in1st;hit-and-run alr=prototest.multivariate(X,y,groups,1,"ALR",21:25,lambda=0.005,hr.iter=20000) #non-selective MS test--specify first column in each group;test for signal in1st ms=prototest.multivariate(X,y,groups,1,"MS",c(1,21,41,61))print(alr)print(ms)prototest.univariate Perform Prototype or F Tests for Significance of Groups of Predictorsin the Univariate ModelDescriptionPerform prototype or F tests for significance of groups of predictors in the univariate model.Choose either exact or approximate likelihood ratio prototype tests(ELR)or(ALR)or F test or marginal screening prototype test.Options for selective or non-selective tests.Further options for non-sampling or hit-and-run null reference distributions for selective tests.Usageprototest.univariate(x,y,type=c("ALR","ELR","MS","F"),selected.col=NULL,lambda,mu=NULL,sigma=1,hr.iter=50000,hr.burn.in=5000,verbose=FALSE,tol=10^-8)Argumentsx input matrix of dimension n-by-p,where p is the number of predictors in a single predetermined group of predictors.Will be mean centered and standardisedbefore tests are performed.y response variable.Vector of length emphn,assumed to be quantitative.type type of test to be performed.Can only select one at a time.Options include the exact and approximate likelihood ratio prototype tests of Reid et al(2015)(ELR,ALR),the F test and the marginal screening prototype test of Reid andTibshirani(2015)(MS).Default is ELR.selected.col preselected columns specified by user.Vector of indices in the set{1,2,...,p}.If specified,a non-selective(classical)version of the chosen test it performed.Inparticular,this means the classicialχ21reference distribution for the likelihoodratio tests and the F reference for the F test.Default is NULL,which directs thefunction to estimate the selected set with the lasso or the marginal screeningprocedure,depending on the test.lambda regularisation parameter for the lassofit.Must be supplied when selected.col is NULL.Will be supplied to glmnet.This is the unstandardised version,equiva-lent to lambda/n supplied to glmnet.mu mean parameter for the response.See Details below.If supplied,it isfirst subtracted from the response to yield a mean-zero(at the population level)vectorfor which we proceed with testing.If NULL(the default),this parameter is treatedas nuisance parameter and accounted for as such in testing.sigma error standard deviation for the response.See Details below.Must be supplied.If not,it is assumed to be1.Required for the computation of some of the teststatistics.hr.iter number of hit-and-run samples required in the reference distrbution of a selec-tive test.Applies only if selected.col is NULL.Default is50000.Since depen-dent samples are generated,large values are required to generate good referencedistributions.If set to0,the function tries to apply a non-sampling selectivetest(provided selected.col is NULL),if possible.If non-sampling test is notpossible,the function exits with a message.hr.burn.in number of burn-in hit-and-run samples.These are generatedfirst so as to make subsequent hit-and-run realisations less dependent on the observed response.Samples are then discarded and do not inform the null reference distribution.verbose should progress be printed?tol convergence threshold for iterative optimisation procedures.DetailsThe model underpinning each of the tests isy=µ+θ·ˆy+where ∼N(0,σ2I)andˆy depends on the particular test considered.In particular,for the ELR,ALR and F tests,we haveˆy=P M(y−µ),where P M=X MXMX M−1XM.X M is the input matrix reduced to the columns in the set M,which,in turn,is either provided by the user(via selected.col)or selected by the lasso(if selected.col is NULL).If the former,a non-selective test is performed;if the latter,a selective test is performed,with the restrictions Ay≤b, as set out in Lee et al(2015).For the marginal screening prototype(MS)test,ˆy=x j∗where x j is the j th column of x and j∗=argmax j|x j y|.All tests test the null hypothesis H0:θ=0.Details of each are described in Reid et al(2015).ValueA list with the following four components:ts The value of the test statistic on the observed data.p.val Valid p-value of the test.selected.col Vector with columns selected.If initially NULL,this will now contain indices of columns selected by the automatic column selection procedures of the test.y.hr Matrix with hit-and-run replications of the response.If sampled selective test was not performed,this will be NULL.Author(s)Stephen ReidReferencesReid,S.and Tibshirani,R.(2015)Sparse regression and marginal testing using cluster prototypes./pdf/1503.00334v2.pdf.Biostatistics doi:10.1093/biostatistics/kxv049Reid,S.,Taylor,J.and Tibshirani,R.(2015)A general framework for estimation and inference from clusters of features.Available online:/abs/1511.07839.See Alsoprototest.multivariateExamplesrequire(prototest)###generate dataset.seed(12345)n=100p=80X=matrix(rnorm(n*p,0,1),ncol=p)beta=rep(0,p)beta[1:3]=0.1#three signal variables:number1,2,3signal=apply(X,1,function(col){sum(beta*col)})intercept=3y=intercept+signal+rnorm(n,0,1)###treat all columns as if in same group and test for signal#non-selective ELR test with nuisance interceptelr=prototest.univariate(X,y,"ELR",selected.col=1:5)#selective F test with nuisance intercept;non-samplingf.test=prototest.univariate(X,y,"F",lambda=0.01,hr.iter=0)print(elr)print(f.test)###assume variables occur in4equally sized groupsnum.groups=4groups=rep(1:num.groups,each=p/num.groups)#selective ALR test--select columns21-25in2nd group;test for signal in1st;hit-and-run alr=prototest.multivariate(X,y,groups,1,"ALR",21:25,lambda=0.005,hr.iter=20000) #non-selective MS test--specify first column in each group;test for signal in1st ms=prototest.multivariate(X,y,groups,1,"MS",c(1,21,41,61))print(alr)print(ms)Indexprint.prototest,3prototest(prototest-package),2prototest-package,2prototest.multivariate,4,5,10 prototest.univariate,4,7,811。

Android上使用grpc的方法教程

Android上使用grpc的方法教程

Android上使⽤grpc的⽅法教程前⾔最近的⼀个项⽬使⽤到了grpc实现跨平台的远程调⽤,在安卓端使⽤的时候遇到了⼀些坑,这⾥记录⼀下。

⾸先根据grpc android的配置grpc依赖,测试它的hello world⼯程。

编译⾕歌官⽅的helloworld⼯程添加rotobuf-gradle-plugin插件⾸先添加rotobuf-gradle-plugin插件,他是⽤来从proto⽂件⾃动⽣成java代码的://Project的build.gradle中添加rotobuf-gradle-plugin插件buildscript {...dependencies {...classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.0"...}...}//App的build.gradle中添加下⾯配置apply plugin: 'com.google.protobuf'protobuf {protoc {artifact = 'com.google.protobuf:protoc:3.0.0'}plugins {javalite {artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0"}grpc {artifact = 'io.grpc:protoc-gen-grpc-java:1.0.0' // CURRENT_GRPC_VERSION}}generateProtoTasks {all().each { task ->task.plugins {javalite {}grpc {// Options added to --grpc_outoption 'lite'}}}}}添加proto⽂件并⾃动⽣成java代码在src/main/⽬录下创建⼀个proto⽬录,并将官⽅的放到proto⽬录下之后只需要rebuild⼀下就能看到build/generated/source/proto/⽬录下根据helloworld.proto⽣成了⼏个Java类添加安卓端grpc的依赖//App的build.gradle中添加下⾯配置dependencies {...compile 'io.grpc:grpc-okhttp:1.1.2'compile 'io.grpc:grpc-protobuf-lite:1.1.2'compile 'io.grpc:grpc-stub:1.1.2'compile 'javax.annotation:javax.annotation-api:1.2'...}configurations.all {resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'}我这个时候报了这个错误Warning:Conflict with dependency ‘com.google.code.findbugs:jsr305'. Resolved versions for app (3.0.0) and test app (2.0.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details.这是因为com.google.code.findbugs:jsr305的版本不⼀致导致的可以在App的build.gradle的android标签中配置⼀下解决android {...configurations.all {resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'}...}编写demo代码public class MainActivity extends AppCompatActivity {private static final String TAG = "GrpcDemo";private static final int PROT = 55055;private static final String NAME = "linjw";private static final String HOST = "localhost";@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(yout.activity_main);startServer(PROT);startClient(HOST, PROT, NAME);}private void startServer(int port){try {Server server = ServerBuilder.forPort(port).addService(new GreeterImpl()).build().start();} catch (IOException e) {e.printStackTrace();Log.d(TAG, e.getMessage());}}private void startClient(String host, int port, String name){new GrpcTask(host, port, name).execute();}private class GreeterImpl extends GreeterGrpc.GreeterImplBase {public void sayHello(HelloRequest request, StreamObserver<HelloReply> responseObserver) { responseObserver.onNext(sayHello(request));responseObserver.onCompleted();}private HelloReply sayHello(HelloRequest request) {return HelloReply.newBuilder().setMessage("hello "+ request.getName()).build();}}private class GrpcTask extends AsyncTask<Void, Void, String> {private String mHost;private String mName;private int mPort;private ManagedChannel mChannel;public GrpcTask(String host, int port, String name) {this.mHost = host;this.mName = name;this.mPort = port;}@Overrideprotected void onPreExecute() {}@Overrideprotected String doInBackground(Void... nothing) {try {mChannel = ManagedChannelBuilder.forAddress(mHost, mPort).usePlaintext(true).build();GreeterGrpc.GreeterBlockingStub stub = GreeterGrpc.newBlockingStub(mChannel);HelloRequest message = HelloRequest.newBuilder().setName(mName).build();HelloReply reply = stub.sayHello(message);return reply.getMessage();} catch (Exception e) {StringWriter sw = new StringWriter();PrintWriter pw = new PrintWriter(sw);e.printStackTrace(pw);pw.flush();return "Failed... : " + System.lineSeparator() + sw;}}@Overrideprotected void onPostExecute(String result) {try {mChannel.shutdown().awaitTermination(1, TimeUnit.SECONDS);} catch (InterruptedException e) {Thread.currentThread().interrupt();}Log.d(TAG, result);}}}这段代码运⾏会崩溃:Caused by: io.grpc.ManagedChannelProvider$ProviderNotFoundException: No functional server found. Try adding a dependency on the grpc-netty artifact猜测google使⽤netty替代了okhttp,尝试换成grpc-netty的依赖:dependencies {...compile 'io.grpc:grpc-netty:1.1.2'compile 'io.grpc:grpc-protobuf-lite:1.1.2'compile 'io.grpc:grpc-stub:1.1.2'compile 'javax.annotation:javax.annotation-api:1.2'...}这么编译会报错com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/INDEX.LIST 需要加上下⾯的配置解决android {...packagingOptions {pickFirst 'META-INF/INDEX.LIST'pickFirst 'META-INF/LICENSE'pickFirst 'META-INF/ty.versions.properties'}...}当然,还需要加上INTERNET权限,要不然运⾏的时候还是会崩溃。

ProtoCessor 快速设置指南说明书

ProtoCessor 快速设置指南说明书
BACnet MS/TP MAC addresses between 1 (A0 ON, A1-A7 OFF) to 127 (A0-A6 ON, A7 OFF) are MAC Master Addresses and can be auto-discovered by BMS frontend systems that support Auto Discovery.
3. Set COM setting (DIP Switches B0 – B3) Set the baud rate per Table 1. All devices connected to ProtoCessor MUST ALL have the same Baud Rate, Data Bits, Stop Bits, and Parity.
Toshiba International Corporation, 13131 W Little York, Houston, TX
Tel: 855-803-7087 Fax: 713-896-5212 Website:
1
P/N 91340A rev. 02
The preset default serial (COM) port settings for the ProtoCessor are:
1. Set the MAC Address (DIP Switches A0 – A7) for BACnet MS/TP or Modbus RTU, and Metasys N2 Node-ID. Only 1 MAC address is set for ProtoNode regardless of how many devices are connected to ProtoNode.

lx2160a-serdes-reconfiguration-user-说明书

lx2160a-serdes-reconfiguration-user-说明书

1IntroductionThe device reference manual provides a list of all supported SerDes protocols.Only SerDes options that have been validated on silicon are documented in the reference manual. Custom SerDes configuration may be supported by reconfiguring the lanes for the desired settings if validated and approved by NXP. Any changes to configuration of default SerDes options require software reconfiguration.This document describes the sequence to reconfigure SerDes lanes from SGMII to USXGMII/XFI and two PCIe x2 lanes at Gen 1 or Gen 2 speeds for the LX2160A device. Subsequent reconfiguration from SFI/XFI to 10GBase-KR or USXGMII shall follow the sequence described in the LX2160A Reference Manual.2SerDes configuration requirementsThis document describes a use case requirement of four lanes of USXGMII/XFI and two PCIe x2 lanes at Gen 1 or Gen 2 speeds,shown as SerDes 1 protocol number 31 in Table 1. Protocol 31 is not one of the default SerDes options for the LX2160A, therefore,it is not documented in the LX2160A Reference Manual. However, standard MC firmware versions 10.24.1 and later add support for protocol 31.This document describes the sequence that results in the target configuration which can be summarized as:1.Start with SerDes protocol 11, which supports four lanes of SGMII on lanes F, E, B, and A, and two PCIe x2 lanes at Gen 3 speed on lanes H, G, D, and C.2.Reconfigure the SGMII lanes to USXGMII/XFI and limit the PCIe lanes to Gen 2 speed.3.Change the PLL assignment for USXGMII/XFI to PLLS since 10G Ethernet only runs on PLLS.4.Change the PLL assignment for PCIe to PLLF since it runs on 5 GHz VCO frequency so it cannot run on the same PLL as USXGMII/XFI.Table 1.SerDes 1 reconfigurationThe reconfiguration sequence assumes the following starting RCW settings:•SRDS_PRTCL_S1 = 5'b01011 to select protocol 11.Contents 1Introduction......................................12SerDes configuration requirements ........................................................13Software sequence.........................24RCWSR29 override. (65)Revision history (7)AN13022LX2160A SerDes 1 Lane Reconfiguration from 11 to 31Rev. 0 — 10/2020Application Note•SRDS_DIV_PEX_S1 = 2'b10 to configure PCIe to train up to a max rate of 5G (Gen 2).•SRDS_PLL_REF_CLK_SEL_S1 = 2'b mn, where m selects the reference clock for the PCIe lanes on PLLS and n selects the reference clock for USXGMII/XFI lanes on PLLF. Example:—m = 0 for 100 MHz PCIe reference clock—n = 1 for 161.1328125 MHz USXGMII/XFI reference clock•SRDS_PLL_PD_PLL1 = 0 and SRDS_PLL_PD_PLL2 = 0 so both PLLF and PLLS are powered up.•SRDS_REFCLKF_DIS_S1 = 0 to keep SD1_PLLF_REF_CLK enabled.•SRDS_INTRA_REF_CLK_S1 = 0 intra reference clock is not used.3Software sequenceThe reconfiguration sequence must be implemented in PBI and is shown below.1.Disable SGMII for lanes A, B, E, and F.•SD1: PCC8 (offset 0x10A0) = 0x0000_0000—SGMIIA_CFG = 0 disable SGMIIa—SGMIIB_CFG = 0 disable SGMIIb—SGMIIE_CFG = 0 disable SGMIIe—SGMIIF_CFG = 0 disable SGMIIf2.Enable XFI mode for lanes A, B, E, and F•SD1: PCCC (offset 0x10B0) = 0x9900_9900—SXGMIIA_XFI = 1 PCS operates in XFI/SFI mode—SXGMIIA_CFG = 001b enable SXGMIIa—SXGMIIB_XFI = 1 PCS operates in XFI/SFI mode—SXGMIIB_CFG = 001b enable SXGMIIb—SXGMIIE_XFI = 1 PCS operates in XFI/SFI mode—SXGMIIE_CFG = 001b enable SXGMIIe—SXGMIIF_XFI = 1 PCS operates in XFI/SFI mode—SXGMIIF_CFG = 001b enable SXGMIIf3.Assume 100 MHz reference clock for PLLF for the PCIe lanes•SD1: PLLFCR0 (offset 0x0404) = 0x0000_0000—REFCLK_SEL = 00000b for 100 MHz4.Configure 5G clock net frequency for PLLF•SD1: PLLFCR1 (offset 0x0408) = 0x9030_0008—SLOW_VCO_EN = 1 to enable the slower VCO—FRATE_SEL = 10000b for PCIe on PLLF—HI_BW_SEL = 1 to select higher PLL bandwidth—CLKD_RCAL_SLW_EN = 1 to enable resistor calibration for clock driver—RTMR_BYP = 1 to bypass retimer to clock driver and SSC phase interpolator—EX_DLY_SEL = 00b5.Set the recommended PLLF settings for PCIe 5G•SD1: PLLFCR3 (offset 0x0410) = 0x0000_3000—SSC_SEL = 00b no PLL modulation—SSC_SLP_OFF = 0000000000b for no slope offset—Bit 13 = 1—Bit 12 = 16.Set the recommended PLLF settings for PCIe 5G•SD1: PLLFCR4 (offset 0x0414) = 0x0000_0000—SSC_BIAS_BST = 000b SSC bias boost—SSC_SAW_MIN = 0000000000b SSC minimum sawtooth frequency offset—SSC_PI_BST = 00000b SSC phase interpolator Iqdiv2 boost—SSC_SAW_MAX = 0000000000b SSC maximum sawtooth frequency offset7.Assume 161.1328125 MHz reference clock for PLLS for 10GE operation•SD1: PLLSCR0 (offset 0x0504) = 0x0004_0000—REFCLK_SEL = 00100b for 161.1328125 MHz8.Configure 10.3125G clock net frequency for PLLS•SD1: PLLSCR1 (offset 0x0508) = 0x8610_0008—SLOW_VCO_EN = 1 to enable the slower VCO—FRATE_SEL = 00110b for XFI/SFI on PLLS—HI_BW_SEL = 0 to do not select higher PLL bandwidth—CLKD_RCAL_SLW_EN = 1 to enable resistor calibration for clock driver—RTMR_BYP = 1 to bypass retimer to clock driver and SSC phase interpolator—EX_DLY_SEL = 00b9.Set the recommended PLLS settings for XFI•SD1: PLLSCR3 (offset 0x0510) = 0x0000_3000—SSC_SEL = 00b no PLL modulation—SSC_SLP_OFF = 0000000000b for no slope offset—Bit 13 = 1—Bit 12 = 110.Set the recommended PLLS settings for XFI•SD1: PLLSCR4 (offset 0x0514) = 0x0000_1000—SSC_BIAS_BST = 000b SSC bias boost—SSC_SAW_MIN = 0000000000b SSC minimum sawtooth frequency offset—SSC_PI_BST = 00010b SSC phase interpolator Iqdiv2 boost—SSC_SAW_MAX = 0000000000b SSC maximum sawtooth frequency offset11.Change the PLL assignment for PCIe on the transmitter for lanes C, D, G, H from PLLS to PLLF•SD1: LNmTGCR0 (offsets 0x0A24 for lane C, 0x0B24 for lane D, 0x0E24 for lane G, 0x0F24 for lane H) = 0x0100_0200—USE_SLOW_PLL = 0 transmit uses PLLF—BY_N_RATE_SEL = 001b PCIe is half rate—CM_DLY_MATCH = 1 changes in LNmTRSTCTL[OUT_CM] are delay matched to changes in transmit data 12.Change the PLL assignment for PCIe on the receiver for lanes C, D, G, H from PLLS to PLLF•SD1: LNmRGCR0 (offsets 0x0A44 for lane C, 0x0B44 for lane D, 0x0E44 for lane G, 0x0F44 for lane H) =0x0100_0001—USE_SLOW_PLL = 0 receive uses PLLF—BY_N_RATE_SEL = 001b PCIe is half rate—PTRM_VCM_SEL = 01b Common mode is HiZ if PLLnRST[EN] or LNmRRSTCTL[EN] is negated.13.Change the protocol for lanes A, B, E, F from SGMII to XFI•SD1: LNmGCR0 (offsets 0x0800 for lane A, 0x0900 for lane B, 0x0C00 for lane E, 0x0D00 for lane F) =0x0000_0052—Bit 28 = 0 Must be 0 for all protocols—PORT_LN0_B = 0 Single-lane protocol—PROTO_SEL = 01010b for XFI—IF_WIDTH = 010b 20-bit interface width14.Set the PLL assignment for XFI on the transmitter for lanes A, B, E, F to PLLS•SD1: LNmTGCR0 (offsets 0x0824 for lane A, 0x0924 for lane B, 0x0C24 for lane E, 0x0D24 for lane F) =0x1000_0000—USE_SLOW_PLL = 1 transmit uses PLLS—BY_N_RATE_SEL = 000b 10G is full rate—CM_DLY_MATCH = 0 changes in LNmTRSTCTL[OUT_CM] are not delay matched to changes in transmit data15.Configure the transmit equalization for lanes A, B, E, F for XFI•SD1: LNmTECR0 (offsets 0x0830 for lane A, 0x0930 for lane B, 0x0C30 for lane E, 0x0D30 for lane F) =0x1080_8307—EQ_TYPE = 001b for 2-tap equalization—EQ_SGN_PREQ = 1 for positive sign for pre-cursor—EQ_PREQ = 0000b for 1.0x drive strength of transmit full swing transition bit to pre-cursor—EQ_SGN_POST1Q = 1 for positive sign for first post-cursor—EQ_POST1Q = 00011b for 1.14x drive strength of transmit full swing transition bit to first post-cursor—EQ_AMP_RED = 000111b for 0.585x overall amplitude reduction16.Set the PLL assignment for XFI on the receiver for lanes A, B, E, F to PLLS•SD1: LNmRGCR0 (offsets 0x0844 for lane A, 0x0944 for lane B, 0x0C44 for lane E, 0x0D44 for lane F) =0x1000_0000—USE_SLOW_PLL = 1 receive uses PLLS—BY_N_RATE_SEL = 000b 10G is full rate—PTRM_VCM_SEL = 00b Common mode impedance is always calibrated to SD_GND17.Set the recommended XFI settings for lanes A, B, E, F•SD1: LNmRGCR1 (offsets 0x0848 for lane A, 0x0948 for lane B, 0x0C48 for lane E, 0x0D48 for lane F) =0x1000_0000—RX_ORD_ELECIDLE = 0 Do not put into ordered idle state—Bit 28 = 1—ENTER_IDLE_FLT_SEL = 00b Bypass unexpected entrance into idle—EXIT_IDLE_FLT_SEL = 000b Force immediate exit from idle state AFTER order idle released and min time in idle—DATA_LOST_TH_SEL = 000b Disable loss of signal detection18.Disable receive equalization gain overrides for lanes A, B, E, F•SD1: LNmRECR0 (offsets 0x0850 for lane A, 0x0950 for lane B, 0x0C50 for lane E, 0x0D50 for lane F) =0x0000_000019.Set the recommended the receive equalization for XFI for lanes A, B, E, F•SD1: LNmRECR2 (offsets 0x0858 for lane A, 0x0958 for lane B, 0x0C58 for lane E, 0x0D58 for lane F) =0x8100_0020—Bit 31 = 1—EQ_BLW_SEL = 01b baseline wander for 10G—Bits 5:4 = 10bThe PBI sequence is shown below:.pbiwrite 0x01EA10A0,0x00000000write 0x01EA10B0,0x99009900write 0x01EA0404,0x00000000write 0x01EA0408,0x90300008write 0x01EA0410,0x00003000write 0x01EA0414,0x00000000write 0x01EA0504,0x00040000write 0x01EA0508,0x86100008write 0x01EA0510,0x00003000write 0x01EA0514,0x00001000write 0x01EA0A24,0x01000200write 0x01EA0A44,0x01000001write 0x01EA0B24,0x01000200write 0x01EA0B44,0x01000001write 0x01EA0E24,0x01000200write 0x01EA0E44,0x01000001write 0x01EA0F24,0x01000200write 0x01EA0F44,0x01000001write 0x01EA0800,0x00000052write 0x01EA0900,0x00000052write 0x01EA0C00,0x00000052write 0x01EA0D00,0x00000052write 0x01EA0824,0x10000000write 0x01EA0924,0x10000000write 0x01EA0C24,0x10000000RCWSR29 override write 0x01EA0D24,0x10000000write 0x01EA0830,0x10808307write 0x01EA0930,0x10808307write 0x01EA0C30,0x10808307write 0x01EA0D30,0x10808307write 0x01EA0844,0x10000000write 0x01EA0944,0x10000000write 0x01EA0C44,0x10000000write 0x01EA0D44,0x10000000write 0x01EA0848,0x10000000write 0x01EA0948,0x10000000write 0x01EA0C48,0x10000000write 0x01EA0D48,0x10000000write 0x01EA0850,0x00000000write 0x01EA0950,0x00000000write 0x01EA0C50,0x00000000write 0x01EA0D50,0x00000000write 0x01EA0858,0x81000020write 0x01EA0958,0x81000020write 0x01EA0C58,0x81000020write 0x01EA0D58,0x81000020.end4RCWSR29 overrideThe Reset Configuration Word Status Registers (RCWSR1:RCWSR32) are written with the RCW information that are read from flash memory by the device at power-on-reset. The RCWSR register values are read-only after exiting reset.Software (U-boot) reads the selected SerDes protocol from RCWSR29. It looks at the SerDes configuration table to find the entry for protocol 31 and its corresponding interfaces. In order for software (U-boot) to read the updated SerDes 1 protocol value of 31, the following steps must be performed:1.Add an entry for SerDes 1 protocol 31 in the SerDes configuration table in U-boot2.Override the RCWSR29 with the updated SerDes 1 protocol value of 31•Write to address 0x7_00100170 the new protocol SRDS_PRTCL_S1 = 31.•The SerDes 2 and SerDes 3 configuration fields should remain unchanged.•Note: The RCWSR29 cannot be updated from the PBI phase. The update must be done in the initial stages of the the board-specific U-boot code so that the correct SerDes protocol is read as U-boot continues execution.Table 2.Address 0x7_0010017031302928272625242322212019181716 SRDS_PRTCL_S3SRDS_PRTCL_S2SRDS_PRTCL_S1SRDS_REFCLKF_DIS_S11514131211109876543210Table continues on the next page...Table 2.Address 0x7_00100170 (continued)ReservedSRDS_PLL_P D_PLL6SRDS_PLL_P D_PLL5SRDS_PLL_P D_PLL4SRDS_PLL_P D_PLL3SRDS_PLL_P D_PLL2SRDS_PLL_P D_PLL1Any support, information, and technology (“Materials”) provided by NXP are provided AS IS, without any warranty express or implied, and NXP disclaims all direct and indirect liability and damages in connection with the Material to the maximum extent permitted by the applicable law. NXP accepts no liability for any assistance with applicationsor product design. Materials may only be used in connection with NXP products. Any feedback provided to NXP regarding the Materials may be used by NXP without restriction.5Revision historyThe table below summarizes the revisions to this document.Table 3.Revision history Revision historyHow To Reach Us Home Page: Web Support: /support Information in this document is provided solely to enable system and software implementersto use NXP products. There are no express or implied copyright licenses granted hereunderto design or fabricate any integrated circuits based on the information in this document. NXP reserves the right to make changes without further notice to any products herein.NXP makes no warranty, representation, or guarantee regarding the suitability of its products for any particular purpose, nor does NXP assume any liability arising out of the applicationor use of any product or circuit, and specifically disclaims any and all liability, includingwithout limitation consequential or incidental damages. “Typical” parameters that may be provided in NXP data sheets and/or specifications can and do vary in different applications, and actual performance may vary over time. All operating parameters, including “typicals,”must be validated for each customer application by customer's technical experts. NXP does not convey any license under its patent rights nor the rights of others. NXP sells products pursuant to standard terms and conditions of sale, which can be found at the following address: /SalesTermsandConditions.Security — Customer understands that all NXP products may be subject to unidentifiedor documented vulnerabilities. Customer is responsible for the design and operation of its applications and products throughout their lifecycles to reduce the effect of these vulnerabilities on customer’s applications and products. Customer’s responsibility also extends to other open and/or proprietary technologies supported by NXP products for use in customer’s applications. NXP accepts no liability for any vulnerability. Customer should regularly check security updates from NXP and follow up appropriately. Customer shall select products with security features that best meet rules, regulations, and standards of the intended application and make the ultimate design decisions regarding its products and is solely responsible for compliance with all legal, regulatory, and security related requirements concerning its products, regardless of any information or support that may be provided by NXP. NXP has a Product Security Incident ResponseTeam(PSIRT)(************************)thatmanagestheinvestigation, reporting, and solution release to security vulnerabilities of NXP products.NXP, the NXP logo, Freescale, the Freescale logo, CodeWarrior, Layerscape, and QorIQ are trademarks of NXP B.V. All other product or service names are the property of their respective owners. Arm and Cortex are registered trademarks of Arm Limited (or its subsidiaries) in the US and/or elsewhere. The related technology may be protected by any or all of patents, copyrights, designs and trade secrets. All rights reserved. The Power Architecture and word marks and the Power and logos and related marks are trademarks and service marks licensed by .© NXP B.V. 2020.All rights reserved.For more information, please visit: Forsalesofficeaddresses,pleasesendanemailto:**********************Date of release: 10/2020Document identifier: AN13022。

proto3语法 英文原版

proto3语法 英文原版

proto3语法英文原版Alright, here's a collection of paragraphs about proto3 syntax in an informal and conversational English style, each with a unique voice and structure:When it comes to defining data structures in a concise and readable way, proto3 syntax really shines. It's like a breeze of fresh air in the world of data serialization.I love how proto3 makes it effortless to declare message types. Just specify the fields, their types, and whether they're required or not. It's almost like talking to a friend, straightforward and to the point.One cool thing about proto3 is its flexibility. You can define messages that contain other messages, making it easy to build complex data structures. It's like stacking LEGO bricks, but with code!I find the syntax for defining enumerations in proto3really intuitive. Just list the names and assign them values if needed. It's like having a handy reference guide for all your possible options.One of my favorite features of proto3 is its supportfor repeated fields. This allows you to represent arrays or lists of data in a natural way. It's like having a virtual shopping cart where you can add multiple items of the same type.Overall, proto3 syntax is a joy to work with. It's concise, readable, and powerful, making it a great choice for defining data structures in a variety of applications.。

软件测试英语面试题及答案

软件测试英语面试题及答案### 软件测试英语面试题及答案1. What is software testing?Software testing is the process of evaluating a software application or system to determine whether it meets the specified requirements and to identify any defects or issues that might be present. It is a key phase in the software development life cycle and plays a crucial role in ensuring the quality and reliability of the software product.Answer: Software testing is a systematic process that involves verifying and validating a software application to ensure it meets the requirements and is free from defects. It is essential to improve the quality of the software and to ensure that it functions correctly under various conditions.2. What are the different types of software testing?There are several types of software testing, including:- Functional Testing: Testing individual components or features for both expected and unexpected inputs and comparing the actual results with the expected results.- Non-functional Testing: Evaluating the performance, reliability, usability, and other attributes of the software. - Regression Testing: Ensuring that new changes to thesoftware have not adversely affected existing features.- Integration Testing: Testing the combination of software components to ensure they work together as expected.- System Testing: Testing the complete, integrated software system to evaluate its compliance with the specified requirements.- Acceptance Testing: The final testing stage where the software is tested to ensure it meets the user's acceptance criteria.Answer: The various types of software testing are designed to cover different aspects of software quality. They include functional, non-functional, regression, integration, system, and acceptance testing, each serving a specific purpose in the overall testing process.3. What is the difference between white box testing and black box testing?- White Box Testing: Also known as structural testing or code-based testing, it involves testing the software with knowledge of its internal structure and workings. It is used to check the internal logic and flow of the program.- Black Box Testing: This type of testing is performed without any knowledge of the internal workings of the application. It focuses on the functionality of the software and how it responds to inputs.Answer: White box testing requires an understanding of the software's internal code and structure, while black box testing is based on the software's functionality and externalbehavior. The choice between the two depends on the testing objectives and the information available to the tester.4. What is the purpose of test cases and test suites?Test cases are detailed descriptions of the test scenarios that are designed to verify specific aspects of the software. They include the input, expected results, and the steps to execute the test. A test suite is a collection of test cases that are grouped together to cover a particular feature or functionality of the software.Answer: Test cases and test suites are essential for structured testing. They provide a systematic approach to testing, ensuring that all aspects of the software are evaluated. Test cases help in identifying defects, while test suites help in organizing and prioritizing the testing efforts.5. How do you handle a situation where you find a bug that is not reproducible?When a bug is not reproducible, it can be challenging to diagnose and fix. The steps to handle such a situation include:- Documenting the Bug: Record all the details about the bug, including the steps taken, the environment, and any error messages.- Analyzing the Bug: Try to understand the conditions under which the bug might occur by analyzing the logs, code, andsystem state.- Isolating the Bug: Attempt to isolate the bug by changing one variable at a time to see if the bug can be reproduced. - Communicating with the Team: Discuss the bug with the development team to get insights and possible solutions.- Prioritizing the Bug: If the bug cannot be reproduced, it may be necessary to prioritize it based on its impact and the likelihood of it occurring again.Answer: Reproducibility is key to resolving bugs. However, when a bug is not reproducible, thorough documentation, analysis, isolation, communication, and prioritization are crucial steps in managing the issue effectively.6. How do you prioritize testing efforts?Prioritizing testing efforts is essential to ensure that the most critical parts of the software are tested first. The factors that influence prioritization include:- Risk Assessment: Testing areas with the highest risk of failure first.- Business Value: Prioritizing features that provide the most value to the business.- User Impact: Focusing on features that impact the user experience the most.- Resource Availability: Considering the availability of testing resources.- Development Progress: Aligning testing with the development schedule to ensure that testing is completed in time.Answer: Effective prioritization of testing efforts is a balance between risk, value, user impact, resource availability, and development progress. It's important to have a clear understanding。

2022-2023年软件水平考试《高级网络规划设计师》预测试题6(答案解析)

2022-2023年软件水平考试《高级网络规划设计师》预测试题(答案解析)全文为Word可编辑,若为PDF皆为盗版,请谨慎购买!第壹卷一.综合考点题库(共50题)1.Secure Shell (SSH) is a cryptographic network protocol for operating network services securely over an (此空作答) network, Typical applications include remote command-line, login, and remote command execution, but any network service can be secured with SSH. The protocol works in the ( ) model, which means that the connection in established by-the SSH client connecting to the SSH server. The SSH client drives the connection setup process and uses public key cryptography to verify the ( ) of the SSH server.After the setup phase the SSH protocol uses strong ( ) encryption and hashing algorithms to ensure the privacy and integrity of the data that is exchanged between the client and server. There are several options that can be used for user authentication. The most common ones are passwords and ( ) key authentication. A.encripteDB.unsecureDC.authorizeD.unauthorized正确答案:B本题解析:Secure Shell(SSH)是一种加密网络协议,用于在不安全网络上安全地操作网络服务,典型的应用程序包括远程命令行、登录和远程命令执行,但任何网络服务都可以使用SSH进行安全保护。

ProtoTRAK TRAK LPM 产品手册说明书

More than just a VMC...It’s a machining system forLow Volume / High Mix production.The TRAK LPM is a machining system that integrates thecontrol, machine, tooling and workholding. It gives ProtoTRAK machinists the tools they need to compete and win on the strength of their know-how and skill.How You Compete in Low Volume / High Mix Production Jobs Reduce Labor Hours Spent in SetupDo Job Change-Overs in MinutesThe TRAK LPM reduces the idle time to an absolute minimum so the machine can keep cutting chips. Other VMCs force you to leave the spindle idle while setting up tools and locating parts.The TRAK LPM integrates practical tools to guide you through setups. Other VMCs require more labor-intensive, time-consuming setups.THE TRAK LPMYour ProtoTRAK machinists can program all but the most complex parts...right on the shop floor.• Save the time and cost of routing through a CAD/CAM process • Keep your skilled workers incontrol of how parts get madeThe ProtoTRAK PMX is Always Easy to UseTHE TRAK LPM SYSTEMStaged View for Concurrent Programming and Setup• Program a future job while you’re tending a job that’s already running• Keep the spindle running while setting up almost everyaspect of the next job• Make quick work of part programming in a process the machinist controls • Assure accuracy by usingblueprint data for dimensionsConvert DXF andParasolid FilesSOLID SelectRotatePan3 AXISEVENT INCH Pin 27767FitUndoDrag ZoomSolid/WireFace ViewSet ZBOX ZOOM• Precise positioning in seconds• Repeatable part locationseliminate touching off partsJergens ® Ball Lock System Installed for You• Focus your attention onlyon what needs doing next• Work with confidence without worrying that you’ll forget something importantChecklists Give You Feedback on Your Progress• Saved with the programs so you have instant access whenyou need them• Don’t waste time reinventingwhat you’ve already donePhotos and Notes of YourPast Setups• Run the program with the control handwheel on your first partTRAKing is the Fastest, Surest Way to Prove outa SetupPrograms just like a ProtoTRAK (because it is)The ProtoTRAK that is completely dedicated to Low Volume / High Mix jobsProtoTRAK PMX CNCNot only does the ProtoTRAK PMX have the ability to work on two programs at once, it keeps themachine running for most of the setup of that future job.A simple selection on the control and you’ll be programming and setting up future jobs while a job is running.Staged ViewSetup with a DifferenceProgram Set Up you do those tasks for the In Machine Set Up you do those few things that require the machine to be idle.The ProtoTRAK PMX keeps track of what you’ve done and what needs doing. You’ll be able to focus on a couple of things when the machine is idled.Setup ChecklistThe ProtoTRAK PMX knows the reference tool so you can quickly set Z values for each tool.Reference Tool PresetThe ProtoTRAK PMX knows the positions for the Jergens ® Ball Locks so you can locate the fixture and workplace quickly and precisely.Fixture ReferenceAdvanced Capability Made Easy G-Code EditorMake quick adjustments toG-Code right at the machine.NetworkingAssure print control by keepingprograms in authorized filestorage locations.DXF File ConversionUse the print data to makeprogramming easier.Parasolid File ConversionGo right from solid file to part program in a process that is quick and easy.Graphical Tool Path SimulationSee the entire tool path to assurewhat you’ve programmed is whatyou’ll cut.4TH Axis SimultaneousEven complex geometries aremade easier to setup and run.The ProtoTRAK PMX knows the Ball Lock receiverlocations. Simply reference the part to the fixture, and then load the offsets into the fixture management screen.Within seconds your fixture is positioned within 0.0002’’ and secured with 2250 lbs of clamping force. Follow this simple process and you never need to touch off a part in an idled machine!The optional 4th axis is easily mounted with the Ball Lock System.Multiple fixtures are referenced using the preset locations.Fixture plate with integrated vice for quick setups.Optional Locating Guide Assembly allows you toeasily reference your own features.Fence and precision standoffs for quick, repeatable changes.With a little ingenuity in fixtures, you will slash the time that’s wasted in set up!Follow this simple process and you will never have to touch off tools in an idled machine!standard with every TRAK LPM.Setting the Z Depths of each tool is simple. Just enter the offsets from the reference toolas you touch off.Each TRAK LPM comes with its own reference tool. The tool’s Z dimension is loaded into the ProtoTRAKPMX for you at our factory.Under Your ControlUnlike any other VMC, the TRAK LPM keeps you in control every step of the way. You can work fast, with confidence.Part graphics provide feedback as you program,bringing mistakes to your attention for immediate correction.All green, ready to go!Toolpath Verify exposes any problems in toolpath, including the non-programmed positioning and tool change moves. Give your skilled ProtoTRAK machinists the control they need, and your shop will produce Low Volume/ High Mix parts faster and better than the shops that run a conventional VMC.The Checklist keeps track of what you’ve done and what remains.TRAKing allows you to run your parts at the speed in which you crank the convenient controlhandwheel. It is simply the purest way to make sure everything is correct before you press “GO.”Box-shaped spindlehead castingStiff column and bed box construction 5 tee slots(instead of the usual 4)Class PLinear GuidesExtra wide Y axis supportLarge contacting surfacesCasting features heavyinternal ribbingWide base footprintStrong and rigidMachine Construction40mm diameterprecision ground ballscrews Direct coupled motors maximize efficiencyand precision while minimizing elastic backlash Dual angular contact bearings pretensionthe ballscrews to minimize thermal expansionLinear guides provide smooth, accurate positioningHigh-precision cartridge-type spindle • Four precision angular contact bearings • ABEC 9, P2 (radial run out)• Permanently lubricated – requires no maintenanceTool Carousel16-station carousel tool changerTelescoping CoversProtects all linear guides, ballscrewsand motors.Air and Spray GunsConvenient built-in air and spray gunsNEMA 12NEMA 12 (equivalent) houses the clean, well-organized control andmachine electrical systems.Chip AugerFluid PumpsDual 0.68 hp pumps provide coolant for machining and the built-in wash down nozzles.System OptionsFixture CartHigh quality cart by HuotManufacturing. Lip height and lengthmatches TRAK LPM table positionduring fixture change.4th AxisThe 4th axis hardware is mountedon fixture plates for easy setup.Mobile Tool Setting CartOne comes with every TRAK LPM,you would buy this only if you wantan additional cartVise StopIncludes mag base and 1”, 2” & 3”extensionsBall Lock Liners (Set of Eight)For fixture plates. High precision forPrimary Locating and lower precisionfor secondary locations.Ball Lock Locating GuideAssemblyFor locating your current fixtureson the TRAK LPM table using the balllock system and locating holeson the table. Includes three stops.Ball LockClamping DeviceSet of 4 (4 also come standard)Fixture PlatePrecision plate with primary liners.Comes in three sizes:• Small (shown above) - 16” x 15.5”• Medium – 16” x 24”• Large – 16” x 32”Fixture Plate Set UpFor Kurt D675 ViseIncludes plate, fence, stopand hardware. Does not include vise.Retention Knobs (Cat 40)Set of 16 (Shown installed)Features and SpecificationsLPM SpecificationsOverall L x W x H 13.1’ X 7.4’ X 8.6’Table size 35 3/8" X 19 5/8"Tee slots: 5 x .71" x 3.94" no. x width x pitch Table max load 1000 lbs.Travels: X x Y x Z 31" x 18.5" x 21"Max spindle 24" nose to table Min spindle 3 3/8" nose to table Max clearance 19 1/4" spindle center to columnMax Rapid speed 800 x 800 x 700 X x Y x Z ipm Electrical 208-240V / 78 amps requirements or 415-440V / 44 amps (requires optional transformer)Tool holder type CAT40 Max RPM 8000Tool Capacity 16Max tool weight 15 lbs incl holderMax tool diameter 3.14Tool clamping 1500 lbs force (at 90psi) Tool carousel 18" to table HP Peak 15HP Continuous 10Weight/Shipping Lbs. 7650 / 8000Standard Features• Internal wash down nozzles • Air gun• Wash down gun • Halogen work lights • Auto lube system• Mobile Tool setting system (incl. cart)• Belt drive spindle • Coolant pump • Wash down pump• Fixture clamping devices – set of 4• Status lights • Rigid tapping• Chip Auger (accommodates a third party 12” oil skimmer)• Air blast to clear chips from spindle • Coolant tank 45 gal.Options• Integrated 4th Axis • Fixture Cart• Fixture plates – small, medium and large • Vise fixture kit – fixture plate, fence, stop • Vise Stop Assembly – incl 1”, 2”, 3” extensions • Fixture clamping devices – additional set of 4• Sets of ball lock liners, primary and secondary• Ball lock locating guide• Retention knobs – CAT 40 – set of 16 • Offline programming • DXF File converter• Parasolid file converter • Transformer 440 to 220• BT40 ATC grippersProtoTRAK PMXHardware Specifications• Jog wheel for TRAKing and positioning • 12.1" color active-matrix screen • Industrial-grade Celeron ® processor • 512 MB Ram• 4 User USB connectors • Override of program feedrate • LED status lights built into display • RJ45 Port with 10/100 Ethernet • Override of program spindle speed • 4th axis interfaceSoftware Features - General Operation• Clear, uncluttered screen display • Prompted data inputs • English language – no codes • Soft keys - change within context • Windows ® operating system • Color graphics with adjustable views • Inch/mm selectable• Convenient modes of operation • Absolute Home location • Spindle load indicator• Reference to ball lock locations on table • Dimension reference indicator • Selectable view between Current and Staged programs* Dimensions in inchesOverall DimensionsMachine Set Up Mode Features• Advanced diagnostic routines• Software travel limits set in the factory • Prompted Tool loading and ATC Management• Checklist to assure nothing is forgottenRun Mode Features• TRAKing• 3D G code file run with tool comp • Real time run graphics with tool icon • Countdown clock/run time estimator • Error alarms prevent Run when set up steps are skipped• Work on Staged programs while Current program runsProgram In/Out Mode Features• CAM program converter• Converter for prior-generation ProtoTRAK programs• DXF/DWG file converter (Optional)• Selection of file storage locations • Automatic file back-up routine• Preview graphics for unopened files • Networking• Create Master routine for combining programs• Transfer of Staged program to Current • Tool reconciliation for Master Programs • Parasolid file converter (optional)Control OptionsParasolid File Converter• Import and convert 3D CAD data into ProtoTRAK programs • ChainingDXF File Converter• Import and convert 2D CAD data into ProtoTRAK programs • DXF or DWG files • Chaining• Automatic Gap Closing • Layer control• Easy, prompted process that can be done at the machineCAM Out Converter• Save ProtoTRAK files as CAM files for running on different controls4th Axis OptionHardware and software that allows true 4th axis interpolation. Includes indexer, tailstock and fixture plate.DRO Mode Features• Incremental and absolute dimensions • Jog with selectable feed rates • Powerfeed X, Y or Z• Servo return to 0 absolute• Go To Dimensions from convenient reference• Spindle speed setting with manual override• Selectable handwheel resolution • Convenient choice of dimensional references:Machine Home, Part Zero, Abs Zero or Ball lock locationsProgram Mode Features• Auto Geometry Engine• Geometry-based programming • Tool Path programming • Scaling of print data • Multiple fixture offsets• Programming of Auxiliary Functions • Event Comments• Three-axis Geometry conversational programming• Incremental and absolute dimensions • Automatic diameter cutter comp • Circular interpolation • Linear interpolation• Look –graphics with a single button push • List step – graphics with programmed events displayed• Alphanumeric program names • Program data editing • Program pause• Conrad – automatic corner radius • Programmable spindle speeds • Math helps with graphical interface • Auto load of math solutions• Tool step over adjustable for pocket routines• Pocket bottom finish pass• Selectable ramp or plunge cutter entry • Subroutine repeat of programmed events • Nesting• Rotate about Z axis for skewing data • Copy• Copy rotate • Copy mirror• Tool data entry in event programming • Selectable retract in Bore operationsAuxiliary Functions• Coolant on/off • Air on/off• Pulse indexer (interface for a third party indexer)• Part change table positionCanned Cycles• Position • Drill• Bolt Hole • Mill • Arc• Circle pocket• Rectangular pocket • Irregular Pocket • Circular profile • Rectangular profile • Irregular Profile • Circle Island• Rectangular Island • Irregular Island • Helix• Thread milling • Engrave • Tapping • Face MillEdit Mode Features• Delete events • Erase program• Spreadsheet editing • Global data change • G-Code editor• Clipboard to copy events between programs• Move between subprograms in a master programProgram Set Up Mode Features• Verify Machining Simulation • Advanced tool library • Tool names• Tool length offset with modifiers• Tool path graphics with adjustable views • Program run time estimation clock • Convenient part/fixture management screen• Fixture offsets• Part offsets within fixture• Convenient manual tool handling when tools required exceed ATC capacity • Photo storage and display • Notes• Z Safety Dimension to prevent crashes • Tool Crib• Tool by Tool or Part by Part run strategy • Convenient Tool Reconciliation between programs and ATC• Convenient ATC capacity2615 Homestead Place Rancho Dominguez, CA 90220T | 310.608.44222615 Homestead Place Rancho Dominguez, CA 90220T | 310.608.4422© Copyright 2017, Southwestern Industries Inc., F16897。

CNC milling教程说明书

manufacturing.Practical Experience•Follow instructions to safely operate a mill and usecomputer software to program a mill.•Write a PART program and use industry-standard G andM operations.Mill various take home projects such as a desk•organizer, coaster, yo-yo, and name plate.Curriculum activities orequipment may change as Lab-Volt continually strives to providethe most up-to-date technology-education program.CLIENT WORKSTATION REQUIREMENTSOperating System:Windows XP or higherHardware Specifi cations:Personal computerMemory: 1 GB or higherSound: 16 Bit, full duplexCDRW/DVD combo: 48x or higherHard Drive Space: 30 GB with minimum of 10 GB free space Network Interface Card: 10 Mbps Card (recommended 100 Mbps) Software Specifi cations:Internet Explorer 8 or higher, Flash 10, .Net 3.0 Framework SKILLS AT A GLANCEMathematics Science3-D Modeling AD/DA Conversion Algebra Cause & Effect, Rate & Flow Arithmetic Computer Technology Boolean Logic, Charts Waste Management Coordinating Systems Thinking SkillsCurves & Angles, Sequencing Drawing Conclusions Positive/Negative Values Logical Reasoning Language Arts Problem SolvingNote TakingReading ComprehensionSpelling, Vocabulary, WritingCNC Mill 40070-70The curriculum is a complete learning unit containing work activities appropriate for students to cover a period of twelve lessons.Student Accomplishments:examine the history and development of CNC and CAM.•identify the benef i ts of using CAM software.•describe the main parts of a CNC mill.•explain the concept of Program Reference Zero.•understand CNC mill safety procedures.•discuss codes and instructions used in PART programs.•use CNC Mill software to prepare a CNC PART program •for execution.explore the history of design.•identify the relationship between CAD and CAM.•generate and view a PART program using an existing •design in Fabricus.compile and emulate the PART program using CNC Mill •software.implement a design change using CAD software.•modify the PART program to ref ect design changes.•examine the impact of manufacturing on the environment.•analyze basic instructions contained in PART programs.•prepare the new PART program for manufacturing.•decorate and customize the completed part.•study design geometries and options available in CAD •software.examine G&M codes used in CNC mill programs.•analyze the usage of the X-Y-Z coordinate system in CNC •Mill programs.create new design and emulate generated program code.•manufacture the part which was emulated before.•analyze vises.•explore programming subroutines and loops.•design a part in Fabricus and analyze the generated code.•complete CNC Mill software processing through emulation.•discuss problem determination and problem resolution.•examine Computer Integrated Manufacturing.•explore Flexible Manufacturing Systems.•explore careers in manufacturing.• Equipment, Course-Specifi c Software & Supplies: Mill: mid-size, three-axis milling machine, drilling and•engraving; offers spindle speeds up to 30,000 RPM;features on-board microprocessor and safety features.Mill Software software: provides direct compatibility with G •and M part programs; features onboard microprocessor,editor part program, fast syntax verif i cation, full 3D ToolPath Emulator, and graphical view tool editorCAD/CAM software: entry level CAD/CAM software used •to create GM code f i les; simultaneoulsy displays 4 screen views; design with grid; snap to grid and rulers; safetyglasses; rubber mat; Lexan milling stock; protofoam andwax engraving stock; hex key;Emery block; strings.Headphones (2) with a two-way adapter•Course plaque and mouse pad•Resources, Software & Courseware:Tech-Design eSeries courses contain the complete multimedia curriculum and resources. Supplementing the curriculum are resources such as Key Terms and Words, Timelines, Career Exploration, Environmental Impacts, Internet Link to age- and content-appropriate web sites for student research and T D-Quest projects. Instructor-enabled features such as: narration, electronic annotations, closed captioning, application launches, electronic student journal and lesson delivery options are integrated into the system.Tech Design is facilitated by the Mind-Sight eTraining System. Mind-Sight™ is a seamless integration of courseware delivery and classroom management. You can use the Mind-Sight eTraining System to manage student enrollment, schedule learning activities, customize courseware curriculum, and track performance objectives and assessments. Mind-Sight comes ready to “plug-and-play” on a fully-supported mini-server which has been pre-installed with the management and communication software.Instructional Resources: Instructor’s Guide (answer keys and other information to assist with class preparation), Mind-Sight Installation and User’s Guide (instructions for navigating through the curriculum and using interactive features), Supplemental Comprehensive Assessment Booklet.LAB-VOLT SYSTEMS, INC. • PO BOX 686 • FARMINGDALE NJ 07727 • 1-800-LAB-VOLT • • E-MAIL us@。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

The Options Approach to Software PrototypingDecisionsPrasad Chalasani Somesh Jha Kevin SullivanJuly1997CMU-CS-97-161School of Computer ScienceCarnegie Mellon UniversityPittsburgh,PA15213AbstractPrototyping is often used to predict,or reduce the uncertainty over,the future profitability of a software design choice.Boehm[1]pioneered the use of techniques from statistical decision theory to provide a basis for making prototyping decisions.However his approach does not apply to situations where the software engineer has theflexibility of waiting for more information before making a prototyping decision.Also,his framework considers only uncertainty over one time period,and assumes a design-choice must be made immediately after prototyping.We propose a more general multi-period approach that takes into account theflexibility of being able to postpone the prototyping and design decisions.In particular,we argue that thisflexibility is analogous to theflexibility of exercise of certainfinancial instruments called options,and that the value of theflexibility is the value of the correspondingfinancial option.Thefield of real option theory infinance provides a rigorous framework to analyze the optimal exercise of such options,and this can be applied to the prototyping decision problem.Our approach integrates the timing of prototype decisions and design decisions within a single framework.Author affiliations:Prasad Chalasani,Carnegie Mellon University,chal@,Somesh Jha,Carnegie Mellon University,sjha@,Kevin Sullivan,Universityof Virginia,sullivan@This material is based upon work supported in part by ARPA Grant#F33615-93-1-1330,by ONR Grant #N00014-96-1-1222,and by NSF Grant#IRI-9508191.Keywords:Software engineering,economics,prototyping,real options,sequential invest-ing,financial options1IntroductionAlthough much progress has been made in the identification of key software design paradigms and concepts(such as information-hiding,prototyping,reuse,and program-families),the crite-ria for making decisions about how to use these concepts have largely been ad-hoc.For instance, consider a software engineer faced with the decision of whether to change the implementation of a cache-coherence protocol in a certain distributed database management system.The economic profitability of the new protocol depends on which of two possible future scenarios will occur. In one scenario,the new protocol would work extremely well,whereas in the other,it might de-grade performance.The two scenarios are perhaps estimated to be equally likely,but we do not know which one will occur.Prototyping can be a way to predict(or reduce our uncertainty over) which scenario will occur.Based on the prototype the software engineer can perhaps revise his estimate of the probability of the favorable scenario to70%,and then decide whether or not to change the protocol.Of course constructing and evaluating the prototype involves an expendi-ture of limited resources such as programmer time,CPU time and memory space.The software engineer must therefore weigh the cost of prototyping against the benefit of prototyping.The benefit of prototyping(as we show in an example later)is the increased expected payoff from a more informed decision based on prototyping,compared to a decision without prototyping.Boehm[1]was among thefirst to propose an appealing economics-based approach to pro-viding a sound basis for software decisions in general and prototyping decisions in particular. His approach views software decisions as problems of investing in the face of uncertainty over the future payoffs from the investment.In his model,the effect of prototyping is to change the conditional probabilities of adopting each design alternative given that the future is one of a cer-tain set of possible scenarios.He applies techniques from Bayesian decision theory to calculate the expected payoff from a prototyping decision.Although Boehm’s approach recognizes the importance of uncertainty in modeling prototyp-ing decisions,we see some shortcomings in his approach.To begin with,his approach is based on the traditional net present value(NPV)analysis found in business textbooks:First calculate the present value of the future benefits that the investment(i.e.prototyping and the consequent design choice)will generate.If the future benefits are uncertain,compute the expectation of this present value.Next calculate the(expectation of the)present value of the prototyping and design cost.The NPV is thefirst quantity minus the second,i.e.,benefit minus cost.The soft-ware engineer then applies the NPV rule traditionally found in business textbooks(e.g.,[2]):if the NPV is positive then proceed with the investment,otherwise don’t.However,this simple rule is often suboptimal,since it is founded on a faulty assumption.It views the investor’s(or software engineer’s)decision as a now-or-never decision,in the sense that if the prototyping is not done now,the opportunity is lost for ever.Thus if the only possibilities available to the investor are to invest now or invest never,then he or she should invest if and only if the NPV is positive.However,most investment decisions,including those in the software area,can be de-layed.This is especially true when a certain implementation of the software is already in place, and a design change is being considered.This brings into play several other possible strategies that must be considered when picking the optimal one.Specifically,the investor’s decision can be contingent on what kind of future unfolds.For instance the investor can wait for a month,1and decide to not invest if the next month reveals information that indicates that there would be no net positive payoff from the investment.Or perhaps after a month there is less uncertainty about the profitability of the investment.This type of wait-and-see strategy can have a larger expected payoff(even when discounted to the present time)than investing right away,so that even when the above NPV rule indicates an investment,it would be suboptimal to invest right away.Of course,if the expenditures can somehow be recovered when conditions turn sour,then the decision to invest is effectively reversible,and in this case it would suffice to consider this as a now-or-never decision.However,the expense of undertaking a software design decision cannot usually be recovered.In this sense software decisions,including prototyping decisions, are irreversible but capable of being delayed.Another limitation of Boehm’s framework for prototyping is that he only considers one period of uncertainty,and assumes that both the prototyping and design decisions must be made in this period.However in reality,once the prototyping is done,the software engineer can wait several time periods to obtain more information before making his design choice(especially if a design change is being considered).In this paper we view the prototyping and design decisions not merely as investments un-der uncertainty(as previous work has done),but more specifically as irreversible but delayable investments under uncertainty.In a growing body of research[4,5,6,7,10],this viewpoint is being increasingly accepted as the appropriate one(as opposed to the traditional NPV rule) for analyzing capital investments by companies in the face of an uncertain future.Rather than viewing investments as being either now-or-never propositions or as being reversible,this ap-proach stresses the fact that companies have opportunities to invest,and that they must decide how best to exploit these opportunities.At any time,the company has the option to make the investment:it has the opportunity,but is not obligated to,make the investment.The success of this new research is based on the important observation that investment opportunities are anal-ogous tofinancial call options(see the Appendix for details),and that when a company makes an irreversible investment,it in effect“exercises”its call option.In fact,to make the analogy explicit,the investment opportunity available to the company has been called a“real option”.A real option is theflexibility a manager has for making decisions about real assets(in contrast to shares of stock)[9].Thus the company’s investment problem is essentially one of optimally exercising its call option.The valuation and optimal exercise offinancial options has been an active area of research infinance over the past two decades.Thus researchers have been apply-ing results from the well-established area of options to capital investment problems,and this has lead to the newfield of real option theory.In this paper we are advocating a similar use of the options approach to study software pro-totyping and design decision problems.This has the benefit that we can draw upon the research done in the area of real options.A preliminary paper outlining this approach was presented by one of the authors at the1996Software Architectures Workshop[11].A more detailed paper that applies our ideas to software design decisions appears in[12].Withey[13]also applies real options ideas to analyze strategies for building reusable software modules.The present paper focusses on developing models for analyzing prototyping strategies as well as design strategies that are influenced by prototyping.Since prototyping can affect our estimates of the probabil-ities of future decisions,or our estimates of future payoffs,the model presented in[12]cannot2be used to study prototyping decisions.An additional complication in the current paper is that we study the optimal timing of both the prototyping decision and the resulting design decision in the same framework.(Our earlier paper[12]alludes informally to the possibility of modeling multiple decisions.)Thus in the present paper we need a significantly more complicated model.Our proposal is that formulating software prototyping criteria in terms of real options ad-dresses the limitations of earlier work on prototyping.Moreover,this approach can lead to previously unrecognized design principles.Our goal is to show that real options theory can help describe,and perhaps even prescribe,software prototyping and design decision-making behaviors.The rest of this paper is organized as follows.Section2describes the basic idea of real option theory and how to apply it to software design decisions.Section3and4present two alternative models of prototyping and design-decisions based on the options viewpoint.In the first model,the effect of prototyping is modeled as changing our estimates of the probabilities of future events that affect the profitability of our design choices.In the second model,the effect of prototyping is to change the future payoffs from design choices.This model is related to Boehm’s treatment in[1],and we recast his example in detail in terms of our model.Section5 contains a conclusion.For easy reference,the necessary mathematical terminology and notation is described in Appendix A.1.A brief introduction tofinancial options appears in Appendix A.2. 2Real optionsWe now describe some basic ideas in the area of real options theory.See Appendix A.2for a brief introduction tofinancial options.An investor holding an American call option is faced with a decision problem:when to exercise his option.This situation is very similar to the problem faced by managers making irreversible capital investment decisions.Suppose the manager of a computer peripheral man-ufacturingfirm is contemplating whether to invest in a large factory for making a new kind of widget.The investment is irreversible,since the factory can only be used to make these widgets, and if market conditions turn out to be unfavorable,thefirm cannot regain its lost investment. For simplicity let us say that the factory can be built instantaneously,at a cost,and that it can produce widgets forever at zero cost.Once the factory is built,say at time,the widgets can be sold at the prevailing market price for such widgets.The future profits from widget sales depend on how the market price evolves,which is uncertain.Let be the expected value of these future profits,discounted to time,under a suitable market price model,probability measure, and discounting factor.Thus represents the value of the asset that thefirm can acquire by exercising its option to invest at time.Alternatively,one can think of as the“benefit”from making the investment at time,and as the cost of the investment.In this respect,is analogous to the price of a stock underlying an American call option,and represents the strike price.Clearly thefirm will not invest in the factory if.On the other hand,should thefirm invest simply because exceeds?The traditional Net Present Value(NPV)rule recommends investing in this situation.However,this rule can often be suboptimal since it treats the decision problem as a now-or-never proposition.That is,if there3is no possibility of delaying the decision,then the rule is indeed reasonable.However,if the decision to invest can be postponed,then the NPV rule ignores the value inherent in waiting for better information before making the investment.The option viewpoint is the natural framework in which to quantify the worth of theflexibility of being able to choose between investing now and any future time.Thus the value represents the“value of the option to invest”,or the opportunity cost of investing,at time.The reason we think of as an opportunity cost is that when we exercise the option,we lose the opportunity of being able to decide when to invest.In analogy with the above rule for an American call option,the optimal rule for thefirm is(given suitable definitions of and):Invest if the asset value(or benefit)exceeds the direct cost of the asset plusthe opportunity cost.This idea is at the heart of the theory of real options[5,10].The above approach applies equally well to any investment situation where(a)there is an expenditure of limited resources,(b)there is uncertainty over the future profitability of the in-vestment,(c)the decision to invest is irreverrsible,and(d)the decision can be delayed.As we argued before,many software engineering design decisions,and prototyping decisions in par-ticular,satisfy these criteria.In general suppose a software engineer is contemplating when(if at all)to invest in a prototype.In terms of the variables introduced above,the direct cost is the cost of implementing the prototype.The future profit stream from prototyping is uncertain, and may depend on several factors,such as changes in requirements,hardware,usage-patterns, etc.This uncertainty can be modeled in terms of an event tree(see the Appendix for definitions of this and other terms).At any discrete time,the asset value or benefit is the expected value,discounted to time,of the future(possibly negative)profit stream that would result if the prototype were already in place by time.The option value is then the opportunity cost of implementing the prototype or design-change–the value of theflexibility(which is lost when the prototype is implemented)of being able to decide when to implement the design.Just as in the capital investment scenario above,the optimal decision strategy for the software engineer is: Invest in implementing the prototype when the benefit is at least equal to thedirect cost plus the opportunity cost.We have thus a rigorous way of quantifying when it is beneficial to delay our decision to invest in a prototype.In the next two sections we will present two different models for the effect of prototypes.In both sections we show how to compute the optimal timing of both the prototyping decision and the resulting design-change decision in the same event tree.As we will see,the above simple rule,which works when a prototyping(or design-change)decision is considered in isolation,no longer applies when both decisions are considered.3Prototyping as improving probability estimatesWhen a software designer is contemplating a major,expensive design change,he or she may be concerned about the wisdom of going ahead with the change,since the benefits of making the4change may depend on uncertain future events.We consider a situation where only estimates of the probabilities of these future events are known.In such situations,as Boehm has argued, it may be possible to improve our estimate of these probabilities by building a prototype or simulation of the contemplated software design(or design change).In this section we will present a model based on the assumption that the principal effect of prototyping is in improving our probability estimates.In the next section we will present a different approach.Although we are modeling prototypes as improving our estimates of probabilities of future events,essentially the same model applies to prototypes that are used to reveal information about the current state.In particular,we can view the prototype as being done“just before”, the current state unfolds,and the same mathematics holds.For instance in Boehm’s[1]example the prototype reveals information about whether or not the current state is favorable to a certain design change.Our models are more general and cover scenarios such as those in Boehm’s paper.We will henceforth use the word prototype to cover simulation as well.Although less ex-pensive than changing the software,prototyping can still have a significant cost.Moreover,the expense incurred in prototyping cannot be recovered,making a prototyping decision an irre-versible one.However,the designer has the option to wait for better information before buildinga prototype.Thus a designer is faced with a two-stage decision:1.When(if at all)to invest in a prototype,and2.When(if at all)to switch to the new software(based on the results of prototyping),it beingunderstood that this cannot occur before prototyping(if it is done).We present our model through a concrete example that is easy to generalize.Suppose a database company X is contemplating whether to change the cache-coherence protocol on their top-of-the-line distributed DBMS.Since the future is unknown,it is unclear how this change will impact the company.It may be that in some scenarios the usage of the DBMS is such that the change is unfavorable.The company therefore wants to invest in prototying and simulation. It is faced with two decisions:Decision P:When(if at all)to invest in prototypes and simulation software?For sim-plicity,we assume that that prototypes and simulation software are built together and instantaneously.To allow for different levels of prototyping,we assume that the setrepresents the possible amounts of money that can be invested in prototyping at any time.Decision D:when(if at all)to switch to the new cache-coherence protocol?We of course impose the restriction that prototyping can not occur after switching to the new protocol. We formulate our problem in terms of an event tree of depth(See Appendix A.1for basic mathematical definitions).The branches of this event tree represent various future events that might have an impact on how much benefit the new cache coherence protocol would bring.Notethat for any path in the tree,represents the prefix of consisting of thefirst branches. We use the more general symbol to denote the sub-path of consisting of its branchesfrom time and time.The probability P is defined similarly:it is the product of the probabilities on the branches in.We assume that the branch probabilities are estimates of their true probabilities,and view prototyping as improving on them.For instance,it might be possible to estimate the probability that the usage patterns of the multiprocessor are such that the benefits of using the new protocol are minimal–we refer to this briefly as the“bad”scenario.However,in the absence of the actual implementation of the protocol,these probability estimates are crude at best.We propose that the effect of prototyping is to improve these estimates.In particular,if we decide to invest dollars in prototyping at time,on path,then this changes the probabilities on all branches descending from.We assume that these new probabilities are known.For instance in the absence of prototyping,we might consider the bad scenario as occuring with50%probability. After implementing a small prototype,however,we may revise our estimate of this probability to,say,30%.In general,we assume that at any time there is a set of possible levels of prototyping, i.e.,the possible amounts of money we could spend prototyping.A specific prototyping strat-egy can then be described by a generalized stopping time which is a function from to .That is,for any path,is of the form where denotes when to invest in a prototype along path,and denotes the level of prototyping.We write to refer to thefirst component of,and to refer to the second component of, i.e.,if,then and.Since the prototyping decision is non-clairvoyant,we restrict so that for all,and all,the indicator random variable is-measurable.In other words,both the timing and level of prototyping are based only on what we have seen so far.We let denote the set of all functions that satisfy this restriction.As mentioned before,investing in prototyping according to a generalized stopping time results in a new probability measure P,i.e.,a path has probability P. We write E to denote the expectation under this new measure.We let denote the stopping time that describes the timing of the decision to invest in the new cache-coherence protocol.Since prototyping(if any)can never occur after switching to the new protocol,we impose the restriction:If,then(1)In other words,whenever the prototyping time isfinite,this must be no greater than the switching time.Note that this restriction allows for the situation where prototyping is never undertaken()but the new cache-coherence protocol is implemented(). Thus for a given execution of decision P,there is a set of stopping times for decision D that satisfy the constraint(1).If the decision D is made at time,we define the benefit of switching at time to be the present(i.e.time-)value of the future stream of benefits from switching at time.Suppose the total direct cost of switching to the new implementation is(including any scrapping costs). Since one would never switch if is less than the direct cost,we can say that the payoff from6switching at time iswhich has exactly the same form as the payoff(18)from an American call option.If the decision D is made according to stopping time,then the payoff from this decision is and its present (time0)value is.(Note that when we say that the payoff is we mean that on any event tree path,if,the payoff is.)Similarly,if the prototyping decision is given by,the cost of prototyping is,and its present value is.Thus,given that we invest in prototyping according to the function,and invest in the new coherence protocol according to,the present value of these decisions isE(2) Therefore the present value of our investment opportunity is the maximum of this expression over allowable stopping times:(3)Since and arefinite sets,both’es above exist.A modification of the dynamic programming algorithm of Section A.2can be used to compute,as well as the optimal times and for decisions P and D respectively.A reasonable question at this point is to ask,“what do the optimal strategies and look like”?For instance,the optimal exercise strategy in the case of a simple call option is easy to characterize(see Appendix A.2):Exercise when the option value equals the payoff from immediate exercise.Is there an analogous rule when we are considering two strategies and?To answer this,we mustfirst define what“the payoff from immediate exercise”means,and what the value of our “option”,or investment opportunity(i.e.,the opportunity to do prototyping and switching to a new implementation)means.To this end,we define,at any time,for any allowable prototyping strategy with and any allowable switching strategy with,the value of these strategies at time asE(4)Therefore,in analogy with definition(19)in Appendix A.2,we can define the value of our investment opportunity at time as(5)7Suppose we decide to exercise our option to do prototyping at time at level.What is the payoff from this decision?This is simply the maximum expected payoff,discounted to time ,over all possible switching strategies:E(6) Note that this payoff itself is the value of an option,so in this sense when we are considering the two strategies and,we have an option on an option.Another point to note is that the first term in the payoff represents the“benefit”from prototyping at time at level,whereas the second term,,of course represents the cost of prototyping.In analogy with our characterization of the optimal exercise strategy for a simple call option,we can say(and this can be proved rigorously)that the optimal prototyping strategy is to prototype at time at level if and only if the payoff equals the option value:As mentioned before,we can view as the“opportunity cost”of prototyping at time since this represents the option value that is lost when we decide to prototype at time.Therefore in analogy with call options,the optimal prototyping strategy is:Implement a prototype at time at level only if the benefit exceeds the prototypingcost plus the opportunity cost.To re-emphasize a point we have been making throughout this paper,previous work on pro-totyping that was based on the traditional NPV rule has ignored the opportunity cost.The above rule shows that it may be better to postpone prototyping even when the traditional NPV rule recommends it.Now,once prototyping has been done at some level at time,we must still decide when to switch to the new implementation.This consists offinding which maximizes the payoffdefined in6.At this point the problem is very similar to that of deciding the optimal exercise strategy of a call option,and this analogy has been explored at great length in our earlier paper [12].We only note here that it may often be optimal to wait for a while after prototyping before switching to the new implementation(as we see in the example in the next subsection).3.1An exampleWe now illustrate the above ideas by means of the event tree shown in Fig1.For this example, we assume the cost of switching to the new software design is100.We will assume a discount factor.We will refer to specific(partial)paths in the tree by enumerating the sequence of“up”(U)and“down”(D)branches to be followed in the tree,starting at the leftmost node. We will also use the partial-path notation to refer to the node at the end of the path.The benefit is shown in italics next to each node in the tree.For example on the highlighted path UDU,.In thefigure we show a specific prototyping strategy described by the generalized stopping time.The dark squares show the places where prototyping is done.In particular,on paths8τ= 3Figure1:An event tree showing the effect of prototyping decisions.The nodes of the tree are various states of nature.The dark boxes indicate prototyping decisions described by the gener-alized stopping time,while the circles indicate switching decisions described by the stopping time.When the value of a(generalized)stopping time is indicated at a specific node,this means that all paths that go through that node have that value of the stopping time.9starting with U,,meaning that the prototyping is done at time1,and at“level 10”,in the sense that10monetary units are spent in prototyping.(One unit could represent, say,one thousand dollars).Similarly,on paths starting with DU,,meaning that prototyping is done at time2and at level30.Note that there is no prototyping on paths starting with DD.Recall that we have modeled prototyping as inducing a new probability measure on the paths.The branch probabilities are shown alongside each branch.We have shown all branch probabilities to be0.5up to the time prototyping is done.This indicates our lack of knowledge about the relative likelihood of events in the absence of prototyping.However after prototyping,the probabilities are different from0.5,indicating that we have a better idea of which outcomes are more likely to occur.Thefigure also shows a specific switching strategy described by the stopping time.The circles show the points where switching is done.For instance on paths starting with UU,switch-ing occurs at time2.The switching strategy satisfies the constraint mentioned in the previous subsection:on paths where prototyping is done,the switching cannot occur before prototyping. Also,the payoff from switching at time on any path is,so there is no positive payoff from switching when.Given these two observations,the only places where we need to consider switching are at nodes DUU,U,UU,UUU,and UUD.If we consider various switching strategies(i.e.,stopping times),we see that the optimal strategy is given by the shown in thefigure.This examples illustrates an important point, namely,that it may pay to wait for a while after prototyping.In fact in this example,it is optimal to wait one time period after prototyping,on paths starting with UU and DUU.We now illustrate the calculation of the expected discounted payoff(2)for the specific prototyping strategy and switching strategy:EThe expected present value of these specific prototyping and switching strategies is therefore .4Prototypes as predictorsWe consider a view of prototyping which is a multi-period extension of Boehm’s single-period treatment[1].10。

相关文档
最新文档