设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13003|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
  L7 A* V, l8 m" j& `
* H! B8 m1 W6 d- N. H我的问题是,在每个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中的数值,不知道会不会有什么不妥。
0 B( B' C8 p  N8 O0 q0 E5 o4 R; ^7 W8 F1 L" a
begin P_read arriving
3 @! D2 j, L" ~! m' {( a+ ~    while 1=1 do begin
& M5 a/ K, @! E( n8 r4 m1 C- F        read A_tote from "data.txt" with delimiter "\n"
. Y0 w% P5 u/ I- z* z9 {  F' F        read A_time from "data.txt" with delimiter "\n". @5 \- I0 D8 b! L# A) p, X
        read A_leave from "data.txt" with delimiter "\n"/ [8 b" \/ z% I: s1 f
        read A_picks from "data.txt" with delimiter "\n"! U3 [! G& D4 @1 v4 g
        set load type to A_tote9 H+ K! T* J* F
        if A_tote="tote 1" then set A_induct to 1, R% |2 p; b7 N* g2 c6 R
        else if A_tote="tote 2" then set A_induct to 24 W2 N2 U% q; ]5 t, z
            else set A_induct to 3   
! ?! [% D4 ]+ N1 N, f: J8 {4 @, M& E        set A_i to 0  v2 }, Z. `3 I+ {1 z# Y5 A9 X' n" F
        clone 1 load to P_induction
5 }1 X) T# y4 P) I        wait for A_time sec4 o* T' n1 j9 f9 C2 u8 `* e
    end4 }9 @3 M* }" b
end
( |6 q2 l, }$ }0 {! O8 {" G/ l+ ^: w: B1 R
begin P_induction arriving
# u& F2 I9 b& }$ a/ h    if A_induct=1 then clone 1 load to P_pick1
, l% F: p0 W/ Y! ~* L! q6 N    else if A_induct=2 then clone 1 load to P_pick2
" j; l) V) I( X        else clone 1 load to P_pick3
5 I. f: J3 |- G4 M  zend9 J) M% t5 d, h3 [, {) k1 P
! K6 U1 F- O/ t( |$ v3 j2 ^8 W
begin P_pick1 arriving
) B' f% n0 _+ S7 m  f" A    set A_i to 1
0 ^/ B/ Q1 g) K: t) Y    move into Q_induct1; B  e6 w" a5 ]. E7 Q* m% V
    move into pickaisle.induct16 K7 q2 q  G* x2 y4 y6 |
    while A_i<=30 do begin
/ @7 P( m1 R! |) i        travel to pickaisle.con(A_i)
  N" D2 C7 O4 ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* X, _- p5 Y5 m! D# e4 u6 G        else wait for 10 sec
9 l- I  ^, e% A* L& \1 S; {        if A_i=A_leave then send to die
" \1 o+ N! P& I( l& [        else inc A_i by 1% [" ^  c5 Y% R/ \0 v9 |
    end
1 ~' s' W; h/ T! q, n! g: v  Iend. ?) G; H* m3 [! q8 b8 S
" R4 r- |  P( N5 z
begin P_pick2 arriving
2 P1 C! a& x% W! A: y    set A_i to 11' l# S' y) t# a. M. g+ k! F2 A% i
    move into Q_induct2
9 W& s: s2 Y! u1 o. u8 s. J: Y    move into pickaisle.induct2( ^! j, T, D' G' @2 @! n
    while A_i<=30 do begin& v3 O* ]# U' W
        travel to pickaisle.con(A_i)
2 @9 \' n& c' H* e* ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( M" m4 D6 K+ I- E: k: |        else wait for 10 sec
! e; o( R- A& c! a/ @9 l$ f# y' Z        if A_i=A_leave then send to die
9 ]8 e: c  r3 ?1 n& i( B        else inc A_i by 1& O" H1 b6 U, v/ P2 @% b3 A/ z
    end
2 A, ~4 a$ q5 p' P9 fend
% j, ?( N! d. J0 [: H- l# n( K. z
. }. l1 F( Z; k0 R0 I) ]begin P_pick3 arriving* j6 n, g7 {- `; ~4 Y
    set A_i to 21
: {, y! J, h8 i; J! S    move into Q_induct3
8 u# n( B3 b" F8 h: p/ v    move into pickaisle.induct3
# B  `, G+ _. t2 N9 y# J9 j    while A_i<=30 do begin
$ l0 R" g$ Q4 m& I+ N+ m' ^        travel to pickaisle.con(A_i)
1 G) L* u7 a. P0 y7 W' N& K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 U/ Y9 q0 E/ e' p0 \& G        else wait for 10 sec2 }9 o& K! c5 k8 Z' ^- c5 \$ D
        if A_i=A_leave then send to die
) F+ K) _" k8 Q, u        else inc A_i by 1
* I6 j0 l; j5 S% H. F1 z    end
6 x. e' q9 p/ r/ Gend

最佳答案

查看完整内容

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是个什么东东?6 e2 q2 h* H, n# D% f6 G: V% m% _! N
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
: K- Y; L' ?; `' A4 R0 x+ C7 x: l2 P* }9 j! v3 z
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。+ Q$ Q& ^: b4 |; G" ]

7 o* _$ s# o6 b, s. }* T: Y另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 D) s  Y. `+ {( g; v% R7 A- ^
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;" @1 f5 m8 p& w+ ~9 K0 ]' W& \2 v7 t. L
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
7 d3 A4 ]# S# }+ x4 f# h3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. w+ X0 E  p3 e
begin P_induction arriving/ b( {! q0 D- y  e7 K/ o7 c4 M* }
    clone 1 load to P_pick(A_induct). H5 x6 H# @# r7 v" u, ~
end最大的系
7 C; \9 l" l- g; e0 e7 |0 K9 b7 A& A( A6 p4 r! |8 K6 f
begin P_pick arriving
. p$ f) X7 U+ o0 a$ u: y    set A_i to procindex * 10 + 1
# H9 Z* c! N4 R# }( G& n    move into Q_induct(procindex)
: ]1 P6 g4 i+ c0 s- f  K7 w) |    move into pickaisle.induct(procindex)
! L, F" P# E/ }: ?/ {    /*check the type of pickaisle.induct(i), for your last problem.*/
  H/ s9 |: k$ x: }& L* l
( r- g: ?8 {7 f8 }- P* b    while A_i<=30 do begin
2 ]5 Q+ C2 [+ ]( q        travel to pickaisle.con(A_i)
/ s; C+ ]3 }8 Z+ Q( y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  @4 @3 r  ?1 p( r# x        else wait for 10 sec; q1 _4 V2 x/ |% B; p  E
        if A_i=A_leave then send to die8 p0 I& b7 `) J5 D& y2 N
        else inc A_i by 1
4 G  u8 \/ j2 M5 m) c0 q    end- r7 v; F# t& F( r
end
* e: o% d! P- [( {# `
: q# ?- [: ?, A% E0 G; ]) s' G其中的procindex为整形,代表当前process的序号。
1 p9 l) D( x! R; [& z3 w4 }/ e1 t' jstation和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-3-10 04:51 , Processed in 0.015796 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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