设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12811|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ f' ]: l- O' g; F/ _
, S- Y: ^- t% z0 q
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。' G" b+ P  x) j; `

+ |: ?2 I9 I) t! v% c( q% D, sbegin P_read arriving
2 A7 z& K5 Q- D% m8 y$ L# _    while 1=1 do begin
7 i6 m, s. K- B  g1 n8 R        read A_tote from "data.txt" with delimiter "\n"
) a, {) P3 N% I9 U- X0 [5 W        read A_time from "data.txt" with delimiter "\n"- O6 E2 }+ M& {, j" [0 {8 S- u& q
        read A_leave from "data.txt" with delimiter "\n"
* E, c% {0 k7 \* j0 Z- [5 i! E: u        read A_picks from "data.txt" with delimiter "\n"7 e: r% w: H) h) `, X! m, F' x) C: P
        set load type to A_tote6 F# g( s/ t& u# h, E
        if A_tote="tote 1" then set A_induct to 1! j' x; a) C+ X0 K
        else if A_tote="tote 2" then set A_induct to 2" B7 P* p7 c  C. d( m, G. E
            else set A_induct to 3    5 {5 E# A) B$ f3 V! e
        set A_i to 0
& G$ _3 e: m# o' S, P" h        clone 1 load to P_induction
6 @& e3 g) Z, o; M        wait for A_time sec5 ?7 w0 ~8 a, r0 G9 B! J, h5 a4 C
    end
+ `* ^+ a) }+ v- Eend
2 F2 c4 T$ |/ i1 o
' k6 D5 h: I: V! fbegin P_induction arriving. y! C& |5 X" D/ {  J
    if A_induct=1 then clone 1 load to P_pick1
8 e- e- [8 L- F4 u) H7 r    else if A_induct=2 then clone 1 load to P_pick2/ ]& |* g2 q8 P5 r8 x: B2 w
        else clone 1 load to P_pick3
/ X# v4 |0 l7 C" hend; ?' F4 k/ e0 o2 j
% J' P0 {6 n" W: d
begin P_pick1 arriving
9 H$ Z; O8 f& v! c    set A_i to 1
. v9 x8 q; U, L6 N$ e5 J    move into Q_induct1
# d. {  P. d8 B6 V! _* f    move into pickaisle.induct17 D2 H1 H5 t+ S( N3 Z/ @
    while A_i<=30 do begin1 u7 ^' z  f' u- e
        travel to pickaisle.con(A_i)
" d; _7 v  z& G: k5 g! @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! A  N3 u! r! Q) ^9 H# D
        else wait for 10 sec4 z) e7 q7 j4 e- V' n; L4 P1 I6 W
        if A_i=A_leave then send to die
( Y9 I8 v& w2 |% s1 U" c2 X: `- \        else inc A_i by 1
5 s) [$ ]4 ]$ E/ `    end
: ?* {8 U1 v$ ?2 ]: U9 bend
+ w6 M& I% Q; t* h/ O
  w# I: F1 i9 Rbegin P_pick2 arriving* O- b# E+ s: F, h- L
    set A_i to 113 G8 ~3 i  \1 I7 I* O
    move into Q_induct2
: V1 W- q9 y* b0 l    move into pickaisle.induct2, b% L1 |" B/ k2 h! F
    while A_i<=30 do begin: Q3 w3 a$ t% [' [
        travel to pickaisle.con(A_i)
# _+ L! L3 ]1 @5 G7 e/ ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 p1 ?  T8 w& L1 D. Z
        else wait for 10 sec4 R: u# {  Z7 E+ u
        if A_i=A_leave then send to die0 F: F, T% ?; e+ r$ m% ^- U! x% ^
        else inc A_i by 16 Y& `) n8 ^  G+ {2 i- @: g
    end$ `4 u! K' z* t3 s' D3 n
end2 g. O6 @, ]( _; ~& w3 T

4 W9 r2 q- J2 X( Zbegin P_pick3 arriving  l9 ^: m- i. T: a9 l
    set A_i to 21# |  X& J- Q# Q7 `9 c
    move into Q_induct3
5 h$ H9 n' Z5 ^0 e) T    move into pickaisle.induct3" [! e6 O+ x2 E3 b0 f
    while A_i<=30 do begin- r/ G/ i! I* l0 \( A, o) ^  r. U
        travel to pickaisle.con(A_i)# g! P1 `  m# ]- c5 [7 R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  Y1 D& P0 N8 U2 U        else wait for 10 sec
& l3 [6 S7 c! c+ C3 }1 Q8 o  Y        if A_i=A_leave then send to die
; x4 Z, ^1 [) m/ A: f' J# U        else inc A_i by 11 O; [! i' @. W3 c
    end* }; H  P/ v' B& j* {6 ]
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?- y- B5 A6 Y  Q* y3 s9 D: N7 b
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ A1 V' @2 x% ^, S4 S5 O" D

0 p+ h$ {$ Z2 Q0 A/ tAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。, P! ~3 w& D* k, K

% c! {! c  H5 j, D另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ [& o6 i# W8 J) Z0 D) e3 I  o: O
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  p  Y4 c& E, [2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;+ @6 R) S$ j' L
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, |: [7 b1 o" ^' pbegin P_induction arriving
& Z) k8 {3 C* n3 P    clone 1 load to P_pick(A_induct); r$ P8 R$ r% B" P
end最大的系
6 i1 w/ [4 P* v3 {  W" ^# Y/ b- ]% I# y; L
begin P_pick arriving" a6 p4 M; [- B: L) |# X
    set A_i to procindex * 10 + 1
+ d! a/ q9 K" f' m    move into Q_induct(procindex)
$ |3 S; A' o/ a( F+ \% L    move into pickaisle.induct(procindex); g- l( Z' Z6 B9 K( i. C0 T: G" u0 O
    /*check the type of pickaisle.induct(i), for your last problem.*/; ^6 u" a: v7 D8 R

& @3 H; f1 O- x0 |' U: a3 H& l    while A_i<=30 do begin1 a* _8 \" Y0 [+ Y; {
        travel to pickaisle.con(A_i)
+ e: V: I  W& t- ]  B& ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  ]: e. g4 B; z
        else wait for 10 sec
7 ]  c# w2 u% E# g, H$ l        if A_i=A_leave then send to die
1 F1 y: B2 F( h0 D0 U- v        else inc A_i by 1
+ P5 G1 K; m3 H$ o8 M1 s    end$ p( x, @. P3 \. ^; X
end& q1 d# V- b3 Q! x

0 E; O+ b8 h; U% m" l1 W其中的procindex为整形,代表当前process的序号。& ?1 L* u7 a2 N: y, A5 V" T+ c
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-2-22 08:07 , Processed in 0.022417 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表