设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13745|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 a4 a& s; M6 i5 e( A
7 c( p) U0 m2 ]  h& h/ R: }, E8 k
我的问题是,在每个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 y6 t$ e6 I8 u& |3 p

* ~7 j/ L8 S. b& Zbegin P_read arriving0 H: I" q, `! ^: D5 q
    while 1=1 do begin
# a2 @% v3 s. T& O$ B: J1 n3 K$ q        read A_tote from "data.txt" with delimiter "\n"  _  c' y) n& l! |' g+ f
        read A_time from "data.txt" with delimiter "\n"5 f/ ^8 U4 I" _
        read A_leave from "data.txt" with delimiter "\n"
0 V$ `2 U# d' Q2 E3 Z7 v        read A_picks from "data.txt" with delimiter "\n": L# d4 K  H! d5 u, U. G6 C
        set load type to A_tote
, C6 {9 C. d$ m* f) v' I+ x        if A_tote="tote 1" then set A_induct to 1
  t5 k4 U/ {. F, p        else if A_tote="tote 2" then set A_induct to 2
4 E% A2 F, q, _            else set A_induct to 3   
( s/ ~$ q6 y% ?9 s3 Q, l4 x/ V        set A_i to 0' u" a0 O  [+ f2 G
        clone 1 load to P_induction; V0 Y* Q+ Y. d! n
        wait for A_time sec
& D* }) W& {; m    end. b. ^. v# E& a; J$ {! h
end
2 s# Z0 N8 O8 ^/ t4 e8 y; f# ~3 _
) A8 t2 }- H* T) [8 m6 }* Lbegin P_induction arriving
* B1 I7 A* o5 ^* K- k! E. v    if A_induct=1 then clone 1 load to P_pick10 @3 e4 }' c7 {  i- Z( O+ I3 R
    else if A_induct=2 then clone 1 load to P_pick2
3 S2 [! q& ^/ P" z0 g% `: V        else clone 1 load to P_pick38 W9 t  f  @6 z
end' r* y9 _* a+ m6 M) `' q
# ^# x$ H4 s+ J! U( A
begin P_pick1 arriving7 l; o- |3 C/ ~6 C3 k3 C2 r' A4 ?
    set A_i to 1
4 G6 A9 C( ]7 k6 a, a3 l8 I    move into Q_induct1
9 P$ t! T, K* ?* _2 _    move into pickaisle.induct1
3 V8 i. S; Q) t+ s/ y2 {! B  W# B! L    while A_i<=30 do begin
! ?2 G: A) f& Q. l4 `        travel to pickaisle.con(A_i)
* R$ J2 s+ l0 P3 c4 L1 R1 K! y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) e- C' D/ W& G/ @6 K- ]4 `        else wait for 10 sec
( s4 L: U" l6 y7 E        if A_i=A_leave then send to die+ ?/ M! B1 \  U& X. r
        else inc A_i by 1
& d% C* h4 {* C" S    end2 S5 t* B. h6 w( Z% @( Z
end
1 J+ \9 `8 T  V' Z+ N4 f7 j
0 x3 Y% e1 r" B3 a; xbegin P_pick2 arriving# Y( P7 H3 Y% @; k7 ]. R
    set A_i to 11
) h: n4 b$ ?. M9 G- y5 D    move into Q_induct2
+ U& d+ k$ b% r/ W" C3 F/ y; H3 ]  @    move into pickaisle.induct2
& F4 V- Q* f7 f& r# A3 R" ]    while A_i<=30 do begin
& V0 p" z6 P9 ]$ N        travel to pickaisle.con(A_i)2 G! N9 O/ T& p0 k8 e% I, u) q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: }5 h5 r+ z# ~. J9 _! u        else wait for 10 sec" o/ @$ h, Y/ B$ q
        if A_i=A_leave then send to die( z+ e! |- s, ^0 l$ [; K& h
        else inc A_i by 1
, A5 A. i+ r6 F    end; H; |' l. ^- c2 s# ]2 W2 A; Q
end' [4 G3 O, R8 U( R7 K4 r
( i# v5 O+ W( ?7 r
begin P_pick3 arriving. p2 [& H1 }: O+ g1 |1 K& u
    set A_i to 216 n2 R. i* T8 P$ X2 V. G, j  L
    move into Q_induct3/ W* Y3 l% z4 J4 O
    move into pickaisle.induct38 I2 f4 j4 `$ T" W& o7 M
    while A_i<=30 do begin
  e' w5 O% f0 D; G6 }. g- [+ z        travel to pickaisle.con(A_i)2 H. f: N5 I$ N$ p8 f* _( d# i
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- G( s+ J3 t/ n1 t% f2 o  X2 D' L        else wait for 10 sec
' G4 C4 K- \$ ~: P        if A_i=A_leave then send to die
# g7 F' z3 h9 f        else inc A_i by 1( F5 X/ A) V1 c# {
    end- ~( p+ @, R7 g& n0 m6 C) E' A/ T
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是个什么东东?
! b' ^; _7 N: ~: A6 |' Amove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
3 X4 A+ _7 ?5 a5 v. p9 ?" [3 T  f% s3 T9 G6 ~5 _% q
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。1 Z: V# H1 y* m! k. m+ [
1 K/ x; t0 D: Z% w# P# d
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 B" w' {& i/ W$ H1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;2 D, f! J" E: \; z& ^7 u# B$ K
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;3 J: U' p2 x2 c2 G" A- a; l9 `  }
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
1 @7 P% s: \, i5 Ubegin P_induction arriving. d9 h" T) |2 \
    clone 1 load to P_pick(A_induct)4 D. F, |' M5 a$ t
end最大的系/ c# j" Q6 r/ M0 N, u' Q

5 _; F; @, `8 F3 v1 C5 A5 H; a' Ybegin P_pick arriving6 j& V0 x* _# p' P3 {- G
    set A_i to procindex * 10 + 1; G  I8 O, \& v3 v" T5 `0 \
    move into Q_induct(procindex)8 A; E; O# h" w9 S+ S# ^
    move into pickaisle.induct(procindex)
2 A; x1 O! t0 r1 f    /*check the type of pickaisle.induct(i), for your last problem.*/
/ P, L0 {! A+ Y: g6 e% @  y8 x0 m( D
0 B* e! w0 t5 t9 g- q& _$ j    while A_i<=30 do begin
$ f3 D* h& ], Y  F        travel to pickaisle.con(A_i)& A) D7 T: D; C: U8 l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# R* ^% [/ V( E
        else wait for 10 sec- B1 Q4 [" K9 b% S- {% Q' O  K
        if A_i=A_leave then send to die
" n6 ]' c- x: J! q$ `/ `+ X% d        else inc A_i by 18 F/ a2 k+ G9 `
    end+ |! P5 j1 i8 ~& R( [
end
% v2 h  |0 {) S# l  V+ r) h# r+ `2 I9 O# u1 o
其中的procindex为整形,代表当前process的序号。9 ^" S, w! g$ d
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-5-2 12:40 , Processed in 0.017779 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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