设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13392|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 f% ^- {( o( d  D3 g( F8 c( p% |3 U2 J( E* E% s6 L# \
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
* n! X2 p0 f: \2 M
+ J" m3 a0 r3 `( g- h; Gbegin P_read arriving
+ @% w+ X+ C8 _# m# D    while 1=1 do begin
+ V" ]) V1 b& s! _        read A_tote from "data.txt" with delimiter "\n"
9 v! I/ {, y- O/ p  @4 J1 |        read A_time from "data.txt" with delimiter "\n"
' d2 y4 U" h6 h) ]$ \! x/ x2 [- V        read A_leave from "data.txt" with delimiter "\n"
7 j2 A( w8 _$ q! x' B# q7 ]        read A_picks from "data.txt" with delimiter "\n"* V1 _7 [6 O4 S8 G
        set load type to A_tote+ g$ u  j2 p" u2 m! K% |( x9 V
        if A_tote="tote 1" then set A_induct to 1
9 Y# C4 a$ K* B  F, I& H- x( F  W        else if A_tote="tote 2" then set A_induct to 2
% n" A2 Z/ z2 n1 X) [            else set A_induct to 3   
6 V" f5 D$ q1 s$ [& S# D+ J        set A_i to 08 B# r$ M( F- X* B
        clone 1 load to P_induction" H! w8 G8 J9 V1 {
        wait for A_time sec
" {+ i  o$ A9 {1 X' X    end, F! I1 F9 t2 E9 ^* u6 I
end
  U% y6 X( F+ n, M' e
0 |0 q5 D; y$ \; Nbegin P_induction arriving
: F! K! c7 e+ J; J1 C+ |    if A_induct=1 then clone 1 load to P_pick1
* h. M& M( I) ^0 C4 _2 ~- X    else if A_induct=2 then clone 1 load to P_pick25 k, v: w5 K: Y$ y0 R0 y
        else clone 1 load to P_pick3
' [9 v4 G5 f2 D1 t- ~- ~end: V8 r! ?4 u, d7 @2 g0 |
; q- a5 Q! ]( k+ ?( B- y; S
begin P_pick1 arriving9 t4 e) q; T1 i+ S" y
    set A_i to 1  _! w0 f# J3 L
    move into Q_induct18 c: T% A" I/ N) @
    move into pickaisle.induct1
  u# f# H% O$ y6 u( `/ E    while A_i<=30 do begin
2 |0 _/ W% A% V$ S, T        travel to pickaisle.con(A_i)
0 Q: ~; ?+ j: Y% x! {/ f& e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( k3 `- k' B3 z3 l
        else wait for 10 sec
7 J$ i# N  [% [+ Z1 g! u        if A_i=A_leave then send to die
$ c" T) t9 ]* s! {  k# S- }        else inc A_i by 11 J3 y( f9 }7 i7 R1 [! ?
    end9 p/ q) d/ N1 _" O9 c; `5 A
end( _8 o0 K9 v- y- I% G
& X+ E* _6 O4 i8 T' A' ~+ p% {
begin P_pick2 arriving
% e/ {* u, V& D( U/ r: _    set A_i to 11& ~6 O; S. i: `. p. l# d
    move into Q_induct2
7 @9 q6 @" P  S8 z/ D: H9 O    move into pickaisle.induct2
" r# R# a9 t: J9 A' ~- h( r    while A_i<=30 do begin
! O& J3 D9 D: r1 F        travel to pickaisle.con(A_i)- R/ Z- O4 e8 s3 V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ a( ]5 z8 N$ D        else wait for 10 sec# B" p5 B+ {5 A! G
        if A_i=A_leave then send to die% }, D' l# M: d5 C4 Q
        else inc A_i by 1. S4 g8 T0 ]' k8 n% R+ a5 s
    end% K* C# @+ ^8 M& G1 f5 k- N/ W
end
% i) k, d; y# q3 h4 s) e8 T$ f( X
begin P_pick3 arriving
% A  b7 Q- V& a( P4 k; g0 i    set A_i to 21# N( U& G- Q# S: e+ {
    move into Q_induct37 b) \5 Z) b- c* F
    move into pickaisle.induct35 e7 T1 |. H/ ^6 t+ ~4 s3 v0 W1 o
    while A_i<=30 do begin4 {/ E. O! D2 h1 N6 G$ b
        travel to pickaisle.con(A_i)
' D5 s: }" V8 M+ v: S$ K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  }2 `/ _+ L, z0 W        else wait for 10 sec- [  P$ ?1 w- d2 n& S3 S. F
        if A_i=A_leave then send to die# t- X9 z7 X) ?/ t, ]* v
        else inc A_i by 17 F) H! ~. o' }) x9 ~
    end2 T- r0 L& d, E8 f; D! ]% r- X- S
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是个什么东东?
) e* m/ y! a! s) gmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
0 r* o% N0 [% l
6 _8 N+ z$ L. G& \AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
' T( Y, o) e- x
$ z) d2 r3 p6 q. h# T8 J7 e$ F另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:- d+ j2 K! J$ I1 V0 }
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. K& }7 `& ^8 P' ~2 e2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;& J2 F, z/ v/ N( I0 h9 k' G2 q
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:; _0 T( n! [3 m" }
begin P_induction arriving6 c' H$ N1 z' U4 {& d& R
    clone 1 load to P_pick(A_induct)
) {1 s- b/ r1 I; e8 K! Y1 jend最大的系7 G& P! J: T9 d9 ~' r
% B; i2 k! Z: ~" o% ^
begin P_pick arriving
  p1 h1 V+ V  y& ~4 `9 l7 O: X    set A_i to procindex * 10 + 1
6 ^" |) g. X- b/ i    move into Q_induct(procindex)9 P9 D8 ~3 R8 M; i2 W
    move into pickaisle.induct(procindex)
1 r; K! H' E, _) Q1 D& M    /*check the type of pickaisle.induct(i), for your last problem.*/
) G8 A* p- W8 V6 d
! w/ ?; J/ H/ v8 g9 q    while A_i<=30 do begin4 X5 L6 V) n5 j5 I3 p) q  g  X
        travel to pickaisle.con(A_i)/ u: v% X) l# _0 c1 U4 ^- e' A1 M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 e1 G! h/ L- W2 B9 h
        else wait for 10 sec; s) F! y- D/ Z5 b3 r( P
        if A_i=A_leave then send to die6 Z5 j- C. N; ^/ J6 T  C$ K5 X
        else inc A_i by 1& t7 X/ e; B9 k# c+ S/ N' \  F6 \
    end
0 N+ J+ F) @& M5 Y1 ?5 D1 w4 Gend8 K! ~4 W  a* |

6 l% `% r' F1 c7 F2 ]/ ?其中的procindex为整形,代表当前process的序号。2 L; g% _$ L5 j5 J4 l! c# b
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-4-9 22:00 , Processed in 0.021270 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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