複数の探索者を同じ候補者プールで探すとき

  • 予定パッケージ名
    • HigashiNopponLikelihood
  • 関数名
    • MakeTestPattern
  • タイトル
MakeTestPattern
  • 説明
探索対象者は複数。それぞれの探索対象の候補者も複数。探索対象の候補者には重複がある。でも、ある候補者が複数の探索対象の解になることは許されない。そんなときの、探索パターンを網羅的に作成
  • 使用例
MakeTestPattern(candidates)
  • ソース
MakeTestPattern<-function(candidates){
	gr<-expand.grid(candidates)
	n<-length(gr[,1])
	ok<-rep(1,n)
	for(i in 1:n){
		tmp<-unlist(gr[i,])
		tmp2<-outer(tmp,tmp,"-")
		diag(tmp2)<-1
		if(prod(tmp2)==0){
			ok[i]<-0
		}
	}
	as.matrix(gr[which(ok==1),])
}
  • Rdファイル
\name{MakeTestPattern}
\alias{MakeTestPattern}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
MakeTestPattern
}
\description{
探索対象者は複数。それぞれの探索対象の候補者も複数。探索対象の候補者には重複がある。でも、ある候補者が複数の探索対象の解になることは許されない。そんなときの、探索パターンを網羅的に作成
}
\usage{
MakeTestPattern(candidates)
}
\arguments{
自然数ベクトル
}
%- maybe also 'usage' for other objects documented here.
\details{
%%  ~~ If necessary, more details than the description above ~~
}
\value{
リスト。リストの各要素は行列。
}
\references{
%% ~put references to the literature/web site here ~
}
\author{
%%  ~~who you are~~
}
\note{
%%  ~~further notes~~
}

%% ~Make other sections like Warning with \section{Warning }{....} ~

\seealso{
}

\examples{
candidates<-NULL
tobeSearched<-c(2,4)
for(i in 1:length(tobeSearched)){
	candidates[[i]]<-1:Npool
}
MakeTestPattern(candidates)
}