设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13441|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 ^# t4 B* [) A2 z
: _  n' B$ H/ l; c, {5 }, x9 o
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
1 J3 o" X- M8 C0 v' s, Y
: Q) k9 v+ ?% P& kbegin P_read arriving
* G; m: t. b4 H% @" S) h  ]    while 1=1 do begin
6 K6 |5 s; [  i        read A_tote from "data.txt" with delimiter "\n"
5 [8 I* {# d# Q1 }* U) [7 U) A        read A_time from "data.txt" with delimiter "\n"9 H2 v" ?% F% Y& P' |' o* M
        read A_leave from "data.txt" with delimiter "\n"
% y& w7 q, F- q- m, A# B  V        read A_picks from "data.txt" with delimiter "\n"4 u, L' l( U" P$ y( ?& Y1 y- I3 q
        set load type to A_tote
6 T7 U8 D- R+ \0 M. G/ C# g        if A_tote="tote 1" then set A_induct to 1
% v5 T' p4 [0 v  T" o        else if A_tote="tote 2" then set A_induct to 2
  ], l% v# w& B& w3 d; _            else set A_induct to 3    # v+ q: A5 u; u5 m, _8 |2 y! D
        set A_i to 0
* V0 W1 V5 J, H8 \7 K' f        clone 1 load to P_induction. K- G6 k  M" ?9 S9 I+ N
        wait for A_time sec
4 V$ q- T) x) s$ H    end, l7 R, E9 @" n" J
end
# @6 x+ |; |- G7 Q9 ]: `
6 t. c! a' `$ s  Gbegin P_induction arriving
# {- P( E7 ]  b2 C6 B    if A_induct=1 then clone 1 load to P_pick1
# o4 }/ O' A1 Y$ G    else if A_induct=2 then clone 1 load to P_pick2
3 z% X0 l  f' n: t, ^0 Q8 ?        else clone 1 load to P_pick3; s7 R! n, H) `* v8 P: |  j
end
6 W0 n2 {+ l+ Q1 W$ Q: b" p" k0 ]
4 e* Y, H0 G/ |  cbegin P_pick1 arriving
. n$ b2 k6 I& {2 ^1 I" g    set A_i to 1- T, |3 w8 H$ C! G4 Q
    move into Q_induct1! t( l/ {! h% |: f6 P. [! c; n' f
    move into pickaisle.induct1
6 K% }6 s2 S5 S% ^7 @5 K    while A_i<=30 do begin& k8 L% N- ?5 a* p
        travel to pickaisle.con(A_i)  e' Y* @) {  ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  E/ T1 [4 s4 K( E
        else wait for 10 sec* G: @0 |% v4 x% E9 g) h- J2 p& ]
        if A_i=A_leave then send to die
. [( O+ O( W. \; N0 ~: S1 C% D6 _3 k: [        else inc A_i by 15 e7 f# `6 d- _# g: Y
    end3 q* r* E6 _) C( t/ a$ B
end
1 T4 W/ ]2 y; B2 w1 N1 U* G$ c1 B) e; `' x/ l! p6 o- G8 l7 S
begin P_pick2 arriving& f* Q: x1 _5 u) {6 O
    set A_i to 11( [( W2 {* K: m7 t% S7 N6 w
    move into Q_induct2
0 W- ?0 Q/ x( Y  l' W, C1 l    move into pickaisle.induct2
* Y) p$ l* s$ e/ O: u3 X; T9 s    while A_i<=30 do begin# {1 X6 s9 n! u  x  V+ o
        travel to pickaisle.con(A_i)+ o# h# l6 y0 Z7 M- V7 K& ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! e+ g3 s3 N* |3 q
        else wait for 10 sec
, o8 p' G+ p/ C- A+ p        if A_i=A_leave then send to die
3 k* ?. _+ a. }# r6 h0 _: A: C) b: m: Q        else inc A_i by 1
' F( ^  F) b# L9 C4 H+ m1 H    end
: ^0 h5 \" J9 r, r0 Qend! k, }  m/ ], Z0 |8 W0 C
" Z. i  a# q7 z: g0 B9 I) F0 o
begin P_pick3 arriving$ ~' k, z! e# E( B7 D7 ?* Y0 {; Y. u" G
    set A_i to 21; q9 ?6 K. {+ F% p* e9 `% i! T3 O
    move into Q_induct3
# v. k; j: q, B9 l0 `2 P: B1 p. A    move into pickaisle.induct3
4 g; [# r' K; T1 A/ Q! J    while A_i<=30 do begin  p& s! |6 P4 W8 c  z0 D& l4 Y
        travel to pickaisle.con(A_i)
" y0 Q$ A& D: Z4 C3 L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 j1 f6 }8 x) z9 z        else wait for 10 sec
% f" T8 _4 B$ a$ v        if A_i=A_leave then send to die( D+ n" G3 R) J* _
        else inc A_i by 14 n; y: W  ~5 R! N
    end( k$ T# N; Z8 `$ q
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是个什么东东?' _* H+ V# p4 I% [3 J' B" P
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
- g9 ~/ t! Y1 d- {9 s+ u
4 g& ^, v# S# |2 I+ g0 T) m$ nAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& }! m; m0 X" |0 t! ^3 L6 L6 b8 \: R( V5 z2 I& a
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:2 [) w4 a0 ]7 F: A7 e  j9 E
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
0 i, s( s. w+ Z! I2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
1 C- R' b# Y2 F" e3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, H8 n# h! S6 y8 |
begin P_induction arriving8 m$ R' H- x  D
    clone 1 load to P_pick(A_induct)
# ?9 O, U) E# cend最大的系
4 Q* G$ M' w4 u/ Y
1 m  [; D2 L# o! R! N: ybegin P_pick arriving
3 c6 G! f5 C) n1 Q! _% B( h1 B    set A_i to procindex * 10 + 16 h# V7 ?2 R( _; W" q
    move into Q_induct(procindex)
' `; R1 c( Y' L( a( S    move into pickaisle.induct(procindex)% r; i; w! `  R7 u& P5 V: n
    /*check the type of pickaisle.induct(i), for your last problem.*/
* E/ j" f1 |. j; I  i8 l. R
* ]3 a- H  V! S    while A_i<=30 do begin+ |$ D/ }9 e2 r. L6 e- Y
        travel to pickaisle.con(A_i)
, }- A- q' @* h: u        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 w. @+ Z  ]- _2 Y5 [: @  }5 h        else wait for 10 sec% h( H; m4 v1 r" x5 _
        if A_i=A_leave then send to die! z8 `( U/ T+ }- I: F6 U
        else inc A_i by 1: w* O( q- e# l8 I- }
    end% t/ O1 C0 I) N4 f" y
end
6 W. I& V7 o3 Y9 J9 I) R1 j9 h4 }% r/ J
其中的procindex为整形,代表当前process的序号。
" s0 i4 k! l' u2 s6 sstation和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-4-14 22:56 , Processed in 0.018330 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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