设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15354|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 f1 A/ A) s' ?% W9 c- _$ w" i
: u7 |" F/ S3 s$ w8 s! e我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 G1 K6 M+ O% X! d4 V

/ y, |$ v5 Q& N- A$ M1 a- Obegin P_read arriving
) m. m! Q' u$ _( E  |1 @. S    while 1=1 do begin5 k) \' ~! M9 E, ?( n8 |( m
        read A_tote from "data.txt" with delimiter "\n"8 w/ I. m8 r( R# }$ B2 H) J# C( L
        read A_time from "data.txt" with delimiter "\n"' V- x8 Y) X( k% I0 v0 L, l
        read A_leave from "data.txt" with delimiter "\n"
* V( u5 L8 z& C" G        read A_picks from "data.txt" with delimiter "\n"
8 G2 M9 P7 Y6 f! c        set load type to A_tote% I/ `. r6 \4 Y  S3 U
        if A_tote="tote 1" then set A_induct to 1, s( q+ G3 B6 I' f
        else if A_tote="tote 2" then set A_induct to 2
3 I1 m" e9 c/ m& k2 c$ N& s, b5 m. y            else set A_induct to 3    3 h( Y% t# F% @/ j
        set A_i to 0
7 m& r. z% g" k1 |% k/ d% H        clone 1 load to P_induction
% a' B' |1 c" t) b! b        wait for A_time sec1 N4 d# u0 T# H3 J* c6 I' Z. E
    end
5 R5 [5 n7 W$ @+ ~3 Send
5 t, W# u; o6 l4 v3 r) u& s; d5 D/ g9 ^
begin P_induction arriving4 q# s% G3 t3 ]4 ^2 t: v
    if A_induct=1 then clone 1 load to P_pick1
' }2 E# v( d. l+ t8 ]! g0 U    else if A_induct=2 then clone 1 load to P_pick2! [, Q( ?4 ?) o
        else clone 1 load to P_pick3
' K; D# |9 g9 a0 k. ~! ~/ b8 Uend
3 T/ P$ d4 X; f$ K% f3 `2 A2 O6 |) Y9 C% c/ s! Y9 P9 M
begin P_pick1 arriving5 e; C6 W+ J9 z; |- Z) `- U' w
    set A_i to 16 ?. S9 a3 Q6 Q/ T
    move into Q_induct15 y' o% F! P1 D7 i* g" }- y
    move into pickaisle.induct12 Q) G. y; _6 k6 {1 w
    while A_i<=30 do begin  j6 ^  {8 N& G1 T) {+ X# t' ?9 ?
        travel to pickaisle.con(A_i)- u: f! x6 U  M( u0 v# q) v( @
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% T6 q* y) T1 K4 \# U        else wait for 10 sec' n+ l) m3 }6 G. @, F
        if A_i=A_leave then send to die
/ w( t9 W2 P9 @, K6 \        else inc A_i by 1; ~) F: _8 i( T
    end
  L. L* w) U1 V7 ?/ k" u" rend8 Q# y" A- s) ?$ c8 U( U" S
) j% E  F0 K* K: |0 r$ L4 N
begin P_pick2 arriving
' ]8 b% H$ B! O. [( Q    set A_i to 11
$ N  Y0 C/ J4 ~+ b    move into Q_induct2# }4 n3 N8 D, E1 Y
    move into pickaisle.induct2
# Q* `0 [; Z+ I6 }$ ]  u    while A_i<=30 do begin* i2 K+ {1 Z3 N7 `7 E3 @( O
        travel to pickaisle.con(A_i)
$ ~7 `- P, U4 e) J% R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: X. X2 e7 v# e  L: r& y        else wait for 10 sec6 k; B4 N+ E* g4 I7 }
        if A_i=A_leave then send to die. Q2 R! `+ a! d. ^
        else inc A_i by 1$ r( i. w, B& d
    end
1 i, x. Q; Y/ N( E. k7 b* {end2 P+ I! E( }7 L; q" L8 u
& g# p2 ?' B3 C3 \$ u" t) J
begin P_pick3 arriving" ]* [" b' z  I7 h2 x: F
    set A_i to 21( ?+ N+ q  z9 D
    move into Q_induct3' r) }/ G5 u& P' `6 [
    move into pickaisle.induct3
3 z$ J5 j* A8 I) g+ M( `7 V    while A_i<=30 do begin: i1 t. g) Y  {" Z2 }1 M2 G9 o9 @
        travel to pickaisle.con(A_i)
+ i) Z) c. S3 [2 t+ ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" Z- m4 U. Y2 Q% d
        else wait for 10 sec5 }0 E. h6 ?$ |, A) E
        if A_i=A_leave then send to die
! c% o$ e& q1 ~! ?1 |9 d4 }; i        else inc A_i by 1
* w% F, O! Q1 [' x) |    end% p4 y& T) M/ t  A3 ~
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是个什么东东?0 o0 K, t9 r2 }5 D0 Y9 c+ D
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( e8 f) O  ?! f) u. b" B" O9 z' y# n
6 P( _0 ~2 J2 k/ l* Q# |AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ f% r# l; j$ q( |% U) B2 b, w0 ]9 \: b
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
5 M# x1 {8 D; V- [% f8 z, o1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. H+ U8 x+ N9 y# e2 ?( ~2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;* _! f0 F9 C9 q2 p5 f) w' e- q. F* ?1 N
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
: A/ I( \& c4 m6 ~, bbegin P_induction arriving9 I. D7 q3 |2 t7 w; f
    clone 1 load to P_pick(A_induct)
" C& f+ n" x0 \3 T' c; |end最大的系, H* O/ X& T; X3 Y- ]  c; Z
1 l% z  i  w& H/ M/ S
begin P_pick arriving8 F2 |/ [4 a6 }# P5 o
    set A_i to procindex * 10 + 13 k3 j9 U* m7 x2 \) g. g- Y( P
    move into Q_induct(procindex)
8 B3 c# B, L, _8 `6 ~    move into pickaisle.induct(procindex)
. |& N6 u. {. R; [" {    /*check the type of pickaisle.induct(i), for your last problem.*/) N: E- X  u8 }5 c  L0 \
& V5 y, I3 b0 t
    while A_i<=30 do begin( G. {+ b* \( J  P+ l8 V3 Q
        travel to pickaisle.con(A_i)
- a% O1 Q' [: a+ L. T        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" _9 {1 s9 p' E) H* ^! E
        else wait for 10 sec, D: I7 i- {3 [
        if A_i=A_leave then send to die; {8 ]& Y; E- B! j3 ]
        else inc A_i by 19 |9 v# ]0 C% `$ i) Q5 {  w
    end, ^0 w* W9 e0 U& _
end
: D8 R% @8 z4 {: K. R9 y
% f, T2 J' J8 [其中的procindex为整形,代表当前process的序号。
/ T( e" R& @8 |* x! ^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-9-4 15:46 , Processed in 0.020204 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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